diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 093d9325..a3d9195c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,15 @@ jobs: run: cd azure_devops_rust_api && cargo clippy --all-features --examples -- --deny warnings - name: azure_devops_rust_api build run: cd azure_devops_rust_api && cargo build --all-features + - name: blocking-only build excludes async runtime + run: | + cd azure_devops_rust_api + cargo clippy --no-default-features --features git,ureq -- --deny warnings + deps=$(cargo tree -e normal --prefix none --no-default-features --features git,ureq) + if echo "$deps" | grep -E "^(tokio|hyper|reqwest) v"; then + echo "::error::blocking-only (ureq) build depends on an async runtime/HTTP stack" + exit 1 + fi - name: cleanup azure_devops_rust_api build artifacts run: rm -rf azure_devops_rust_api/target # Remove wasm32 build due to issues with getrandom @@ -47,6 +56,6 @@ jobs: #- 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 + run: cd azure_devops_rust_api && cargo test --all-features - name: azure_devops_rust_api documentation generation run: cd azure_devops_rust_api && cargo doc --all-features --no-deps diff --git a/CHANGELOG.md b/CHANGELOG.md index 160e1292..a6313e8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Blocking (non-async) API ([#835](https://github.com/microsoft/azure-devops-rust-api/issues/835)). + Each module has a `blocking` submodule with a `ClientBuilder` that takes a + `blocking::HttpClient` implementation to send requests. Implementations are provided + for `ureq` (`ureq` feature) and `reqwest::blocking` (`reqwest_blocking` feature). + Only PAT and unauthenticated credentials are supported. +- `RequestBuilder::build_request()` to build an operation's HTTP request without sending it. + +### Changes + +- Operation `RequestBuilder` types now have a client type parameter, which defaults to the + async client, so existing code that names `RequestBuilder` is unaffected. +- `azure_core`'s default features (async `reqwest` transport, `tokio`) are now enabled via + this crate's `reqwest` feature (enabled by default), rather than unconditionally. This + allows blocking-only builds (`default-features = false, features = ["ureq", ...]`) without + `tokio`, `hyper` or async `reqwest`. Default builds are unchanged, but if you disable + default features and use the async client, you must now enable the `reqwest` feature or + provide your own transport. + ## [0.39.1] ### Changes diff --git a/CLAUDE.md b/CLAUDE.md index 15c5f7fa..590c68c1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -61,6 +61,7 @@ cargo check --all-features --examples - `azure_devops_rust_api/src/telemetry.rs` — telemetry pipeline policy - `azure_devops_rust_api/src/headers.rs` — common header helpers - `azure_devops_rust_api/src/artifacts_download/` — Universal Package download client (dedup protocol) +- `azure_devops_rust_api/src/blocking.rs` — `HttpClient` trait and `ureq`/`reqwest` implementations used by the generated blocking clients ### Code generator internals (`autorust/`) @@ -71,6 +72,7 @@ cargo check --all-features --examples - `request_builder_into_future.rs` — into_body()/into_model() calls - `response_code.rs` — Response type definitions - `autorust/codegen/src/codegen_models.rs` — generates model structs/enums +- Blocking clients: when `RunConfig.generate_blocking` is set (in `ado-autorust/src/main.rs`), each module also gets a `blocking` submodule (`create_client_and_builder.rs`), and request builders become generic over the client type (`request_builder_struct.rs`, `request_builder_send.rs`) - `autorust/autorust.toml` — config for boxed/optional/invalid properties (fixes recursive type issues) ### Patcher (`vsts-api-patcher/`) diff --git a/SKILL.md b/SKILL.md index e6464e76..208ac7d6 100644 --- a/SKILL.md +++ b/SKILL.md @@ -22,7 +22,7 @@ Edit `azure_devops_rust_api/Cargo.toml`: ### 4. Update the README version Edit `azure_devops_rust_api/README.md`: -- Update the example `Cargo.toml` snippet: `azure_devops_rust_api = { version = "X.Y.0", ... }` +- Update the example `Cargo.toml` snippets: `azure_devops_rust_api = { version = "X.Y.0", ... }` ### 5. Update the CHANGELOG diff --git a/autorust/ado-autorust/src/main.rs b/autorust/ado-autorust/src/main.rs index 141c440c..0bf172e8 100644 --- a/autorust/ado-autorust/src/main.rs +++ b/autorust/ado-autorust/src/main.rs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -// gen_ado.rs +// ado-autorust main.rs // Main Azure DevOps crate code generation entry point use autorust_codegen::autorust_toml; use autorust_codegen::{self, CrateConfig, Result, RunConfig}; @@ -14,6 +14,8 @@ fn main() -> Result<()> { let package_config = autorust_toml::read("autorust.toml".into())?; let run_config = &mut RunConfig::new("azure_devops_rust_api_"); + // Also generate a blocking (non-async) client for each module. + run_config.generate_blocking = true; let root_spec_folder: Utf8PathBuf = ROOT_SPEC_DIR.into(); let root_output_folder: Utf8PathBuf = "../azure_devops_rust_api/src".into(); let modules = [ diff --git a/autorust/codegen/examples/list_crates.rs b/autorust/codegen/examples/list_crates.rs deleted file mode 100644 index 3d6dc806..00000000 --- a/autorust/codegen/examples/list_crates.rs +++ /dev/null @@ -1,33 +0,0 @@ -// cargo run --example list_crates -// This list all crates that are generated. - -// cargo run --example list_crates -- 0.1.0 -// If a version is passed in as an option, it will filter out any that -// are already published to crates.io. -// An updated clone of crates.io-index is required. -// git clone https://github.com/rust-lang/crates.io-index - -use autorust_codegen::crates::has_version; -use autorust_codegen::crates::list_crate_names; -pub type Result = std::result::Result>; - -fn main() -> Result<()> { - let version = std::env::args().nth(1); - let names = list_crate_names()?; - match &version { - Some(version) => { - for name in names.iter() { - if !has_version(name, version)? { - println!("{name}"); - // println!("cargo owner --add github:Azure:azure-sdk-publish-rust -- {}", name); - } - } - } - None => { - for (i, name) in names.iter().enumerate() { - println!("{} {}", i + 1, name); - } - } - } - Ok(()) -} diff --git a/autorust/codegen/examples/owned_crates.rs b/autorust/codegen/examples/owned_crates.rs deleted file mode 100644 index af42f7a9..00000000 --- a/autorust/codegen/examples/owned_crates.rs +++ /dev/null @@ -1,30 +0,0 @@ -// cargo run --example owned_crates -// Validates that the GitHub team has ownership of all crates. -// If not, it prints the command to add the crate. - -use autorust_codegen::crates::list_crate_names; - -/// https://github.com/orgs/Azure/teams/azure-sdk-publish-rust -/// https://crates.io/teams/github:azure:azure-sdk-publish-rust -const TEAM: &str = "github:azure:azure-sdk-publish-rust"; - -use crates_io_api::SyncClient; -pub type Result = std::result::Result>; - -fn main() -> Result<()> { - let client = &SyncClient::new("azure-sdk-for-rust", std::time::Duration::from_millis(1000))?; - for crate_name in &list_crate_names()? { - if !is_owner(client, crate_name)? { - println!("cargo owner --add {TEAM} -- {crate_name}") - } - } - Ok(()) -} - -// This looks up each crate individually. -// It would be more efficient to get a list of crates for a user if possible. -// https://github.com/theduke/crates-io-api/issues/52 -fn is_owner(client: &SyncClient, crate_name: &str) -> Result { - let cr = client.full_crate(crate_name, false)?; - Ok(cr.owners.iter().any(|owner| owner.login == TEAM)) -} diff --git a/autorust/codegen/src/bin/gen_ado.rs b/autorust/codegen/src/bin/gen_ado.rs deleted file mode 100644 index c9762dc4..00000000 --- a/autorust/codegen/src/bin/gen_ado.rs +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -// gen_ado.rs -// Main Azure DevOps crate code generation entry point -use autorust_codegen::autorust_toml; -use autorust_codegen::{self, CrateConfig, Result, RunConfig}; -use camino::Utf8PathBuf; - -const API_VERSION: &str = "7.1"; -const ROOT_SPEC_DIR: &str = "../../vsts-rest-api-specs.patched/specification"; - -fn main() -> Result<()> { - let package_config = autorust_toml::read("autorust.toml".into())?; - - let run_config = &mut RunConfig::new("azure_devops_rust_api_"); - let root_spec_folder: Utf8PathBuf = ROOT_SPEC_DIR.into(); - let root_output_folder: Utf8PathBuf = "../../azure_devops_rust_api/src".into(); - let modules = [ - (vec!["account/{VERSION}/accounts.json"], "accounts"), - ( - vec![ - "approvalsAndChecks/{VERSION}/pipelinePermissions.json", - "approvalsAndChecks/{VERSION}/pipelinesChecks.json", - "approvalsAndChecks/{VERSION}/pipelinesapproval.json", - ], - "approvals_and_checks", - ), - ( - vec![ - "artifacts/{VERSION}/feed.json", - "artifacts/{VERSION}/provenance.json", - "artifacts/{VERSION}/sbom.json", - ], - "artifacts", - ), - ( - vec![ - "artifactsPackageTypes/{VERSION}/maven.json", - "artifactsPackageTypes/{VERSION}/npm.json", - "artifactsPackageTypes/{VERSION}/nuGet.json", - "artifactsPackageTypes/{VERSION}/pyPiApi.json", - "artifactsPackageTypes/{VERSION}/universal.json", - ], - "artifacts_package_types", - ), - (vec!["audit/{VERSION}/audit.json"], "audit"), - (vec!["build/{VERSION}/build.json"], "build"), - (vec!["core/{VERSION}/core.json"], "core"), - (vec!["dashboard/{VERSION}/dashboard.json"], "dashboard"), - ( - vec![ - "distributedTask/{VERSION}/task.json", - "distributedTask/{VERSION}/taskAgent.json", - "distributedTask/{VERSION}/elastic.json", - ], - "distributed_task", - ), - ( - vec!["extensionManagement/{VERSION}/extensionManagement.json"], - "extension_management", - ), - (vec!["favorite/{VERSION}/favorite.json"], "favorite"), - (vec!["git/{VERSION}/git.json"], "git"), - (vec!["graph/{VERSION}/graph.json"], "graph"), - (vec!["hooks/{VERSION}/serviceHooks.json"], "hooks"), - (vec!["ims/{VERSION}/identities.json"], "ims"), - // Fails autorust codegen with "array expected to have items" - ( - vec!["memberEntitlementManagement/{VERSION}/memberEntitlementManagement.json"], - "member_entitlement_management", - ), - // Fails autorust codegen with "data did not match any variant of untagged enum ReferenceOr" - // ( - // vec!["notification/{VERSION}/notification.json"], - // "notification", - // ), - (vec!["operations/{VERSION}/operations.json"], "operations"), - ( - vec!["permissionsReport/{VERSION}/permissionsReport.json"], - "permissions_report", - ), - (vec!["pipelines/{VERSION}/pipelines.json"], "pipelines"), - (vec!["policy/{VERSION}/policy.json"], "policy"), - ( - vec!["processadmin/{VERSION}/workItemTrackingProcessTemplate.json"], - "processadmin", - ), - ( - vec!["processes/{VERSION}/workItemTrackingProcess.json"], - "processes", - ), - (vec!["profile/{VERSION}/profile.json"], "profile"), - (vec!["release/{VERSION}/release.json"], "release"), - (vec!["search/{VERSION}/search.json"], "search"), - (vec!["security/{VERSION}/security.json"], "security"), - ( - vec!["securityRoles/{VERSION}/securityRoles.json"], - "security_roles", - ), - ( - vec!["serviceEndpoint/{VERSION}/serviceEndpoint.json"], - "service_endpoint", - ), - (vec!["status/{VERSION}/status.json"], "status"), - (vec!["symbol/{VERSION}/symbol.json"], "symbol"), - (vec!["test/{VERSION}/test.json"], "test"), - (vec!["testPlan/{VERSION}/testPlan.json"], "test_plan"), - ( - vec!["testResults/{VERSION}/testResults.json"], - "test_results", - ), - (vec!["tfvc/{VERSION}/tfvc.json"], "tfvc"), - (vec!["tokenAdmin/{VERSION}/tokenAdmin.json"], "token_admin"), - (vec!["tokens/{VERSION}/tokens.json"], "tokens"), - (vec!["wiki/{VERSION}/wiki.json"], "wiki"), - (vec!["wit/{VERSION}/workItemTracking.json"], "wit"), - (vec!["work/{VERSION}/work.json"], "work"), - ]; - - for (input_files, module_name) in modules { - let mut output_folder = root_output_folder.clone(); - - let input_files = input_files - .iter() - .map(|filename| { - let mut input_file = root_spec_folder.clone(); - input_file.push( - filename - .replace("{VERSION}", API_VERSION) - .replace("{ROOT_SPEC_DIR}", ROOT_SPEC_DIR), - ); - input_file - }) - .collect(); - - output_folder.push(module_name); - let crate_config = CrateConfig { - run_config, - output_folder, - input_files, - }; - - // Generate module - println!("Generating module: {}", module_name); - let _cg = crate::autorust_codegen::run(&crate_config, &package_config)?; - } - - Ok(()) -} diff --git a/autorust/codegen/src/codegen.rs b/autorust/codegen/src/codegen.rs index 742728e5..f1dea237 100644 --- a/autorust/codegen/src/codegen.rs +++ b/autorust/codegen/src/codegen.rs @@ -76,6 +76,10 @@ impl<'a> CodeGen<'a> { &self.crate_config.output_folder } + pub fn generate_blocking(&self) -> bool { + self.crate_config.generate_blocking() + } + pub fn should_workaround_case(&self) -> bool { if let Some(title) = self.spec.title() { self.fix_case_properties.contains(title) diff --git a/autorust/codegen/src/codegen_operations.rs b/autorust/codegen/src/codegen_operations.rs index 3427d9ca..ff007723 100644 --- a/autorust/codegen/src/codegen_operations.rs +++ b/autorust/codegen/src/codegen_operations.rs @@ -22,7 +22,7 @@ use proc_macro2::{Ident, TokenStream}; use quote::{quote, ToTokens}; use std::collections::BTreeSet; -use self::create_client_and_builder::create_client; +use self::create_client_and_builder::{create_blocking_client, create_client}; use self::operations::OperationCode; use self::web_operation_gen::WebOperationGen; @@ -89,15 +89,43 @@ pub fn create_operations(cg: &CodeGen) -> Result { } } + let mut blocking_group_modules = TokenStream::new(); for (module_name, operation_code) in operations_code { let OperationCode { client_functions, module_code, } = operation_code; let mut builders = TokenStream::new(); + let mut blocking_builders = TokenStream::new(); for builder in client_functions { + if cg.generate_blocking() { + let async_client = format!( + "super::super::{}::Client", + module_name.as_deref().unwrap_or_default() + ); + blocking_builders.extend( + builder + .with_blocking_client(quote! { super::Client }, async_client) + .into_token_stream(), + ); + } builders.extend(builder.into_token_stream()); } + if cg.generate_blocking() { + // All operations are in a group (checked in `OperationCode::new`). + let name = parse_ident(module_name.as_deref().unwrap_or_default())?; + blocking_group_modules.extend(quote! { + pub mod #name { + use super::super::models; + // The operation modules (containing the shared request builders). + use super::super::#name::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #blocking_builders + } + } + }); + } match module_name { Some(module_name) => { let name = parse_ident(&module_name)?; @@ -126,6 +154,12 @@ pub fn create_operations(cg: &CodeGen) -> Result { } } } + if cg.generate_blocking() { + file.extend(create_blocking_client( + &module_names, + blocking_group_modules, + )?); + } Ok(file) } 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 828635e9..5ef7bd4f 100644 --- a/autorust/codegen/src/codegen_operations/create_client_and_builder.rs +++ b/autorust/codegen/src/codegen_operations/create_client_and_builder.rs @@ -170,3 +170,113 @@ pub fn create_client(modules: &[String], endpoint: Option<&str>) -> Result Result { + let mut clients = TokenStream::new(); + for md in modules { + let client = format!("{md}_client").to_snake_case_ident()?; + let md = md.to_snake_case_ident()?; + clients.extend(quote! { + pub fn #client(&self) -> #md::Client { + #md::Client(self.clone()) + } + }); + } + + Ok(quote! { + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } + } + + #[doc = "Blocking (non-async) client."] + #[doc = ""] + #[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] + #[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] + #[doc = "the `azure_core` pipeline, so no retry policy is applied."] + #[cfg(feature = "blocking")] + pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self.endpoint.unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send(&self, request: &mut azure_core::http::Request) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + + #clients + } + + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + + #group_modules + } + }) +} diff --git a/autorust/codegen/src/codegen_operations/function_code.rs b/autorust/codegen/src/codegen_operations/function_code.rs index 6b2245ef..1f36ae99 100644 --- a/autorust/codegen/src/codegen_operations/function_code.rs +++ b/autorust/codegen/src/codegen_operations/function_code.rs @@ -6,6 +6,12 @@ use super::{ function_params::{FunctionCallParamsCode, FunctionParam, FunctionParams}, web_operation_gen::WebOperationGen, }; +#[derive(Clone)] +struct BlockingClientFunction { + client_type: TokenStream, + async_client: String, +} + /// Create the client function that produces the request builder instance. #[derive(Clone)] pub(crate) struct ClientFunctionCode { @@ -14,6 +20,8 @@ pub(crate) struct ClientFunctionCode { fname: Ident, parameters: FunctionParams, in_operation_group: bool, + /// Set for a blocking client function (see `with_blocking_client`). + blocking: Option, } impl ClientFunctionCode { @@ -31,8 +39,23 @@ impl ClientFunctionCode { fname, parameters: parameters.clone(), in_operation_group, + blocking: None, }) } + + /// Returns a copy of this function for a blocking client. + /// + /// `client_type` is the blocking client type, and `async_client` is the path of the + /// corresponding async client, whose documentation is linked to rather than repeated. + pub fn with_blocking_client(&self, client_type: TokenStream, async_client: String) -> Self { + Self { + blocking: Some(BlockingClientFunction { + client_type, + async_client, + }), + ..self.clone() + } + } } impl ToTokens for ClientFunctionCode { @@ -98,11 +121,31 @@ impl ToTokens for ClientFunctionCode { let fname = &self.fname; let parameters = FunctionCallParamsCode(self.parameters.clone()); + let generics = match &self.blocking { + Some(BlockingClientFunction { client_type, .. }) => quote! { <#client_type> }, + None => quote! {}, + }; + // Blocking client functions link to the async function's documentation, + // rather than repeating the argument descriptions. + let param_descriptions = match &self.blocking { + Some(BlockingClientFunction { async_client, .. }) => { + let doc = format!( + "See [`{fname}`]({async_client}::{fname}) for details of the arguments." + ); + let blank = if summary.is_empty() && description.is_empty() { + quote! {} + } else { + quote! { #[doc = ""] } + }; + vec![quote! { #blank #[doc = #doc] }] + } + None => param_descriptions, + }; tokens.extend(quote! { #summary #description #(#param_descriptions)* - pub fn #fname(#parameters) -> #fname::RequestBuilder { + pub fn #fname(#parameters) -> #fname::RequestBuilder #generics { #fname::RequestBuilder { #(#params),* } diff --git a/autorust/codegen/src/codegen_operations/new_request_code.rs b/autorust/codegen/src/codegen_operations/new_request_code.rs index 8f88c0eb..887294bd 100644 --- a/autorust/codegen/src/codegen_operations/new_request_code.rs +++ b/autorust/codegen/src/codegen_operations/new_request_code.rs @@ -37,7 +37,7 @@ impl ToTokens for AuthCode { } } -fn verb_to_tokens(verb: &WebVerb) -> TokenStream { +pub(crate) fn verb_to_tokens(verb: &WebVerb) -> TokenStream { match verb { WebVerb::Get => quote! { azure_core::http::Method::Get }, WebVerb::Post => quote! { azure_core::http::Method::Post }, diff --git a/autorust/codegen/src/codegen_operations/operation_module.rs b/autorust/codegen/src/codegen_operations/operation_module.rs index e3510758..d10150a6 100644 --- a/autorust/codegen/src/codegen_operations/operation_module.rs +++ b/autorust/codegen/src/codegen_operations/operation_module.rs @@ -14,6 +14,7 @@ pub struct OperationModuleCode { pub request_builder_setters_code: RequestBuilderSettersCode, pub request_builder_send_code: RequestBuilderSendCode, pub request_builder_intofuture_code: RequestBuilderIntoFutureCode, + pub generate_blocking: bool, } impl ToTokens for OperationModuleCode { fn to_tokens(&self, tokens: &mut TokenStream) { @@ -24,7 +25,25 @@ impl ToTokens for OperationModuleCode { request_builder_setters_code, request_builder_send_code, request_builder_intofuture_code, + generate_blocking, } = &self; + // With a blocking client the request builder is generic over the client type, + // and the send code provides its own (client-specific) impl blocks. + let request_builder_impls = if *generate_blocking { + quote! { + impl RequestBuilder { + #request_builder_setters_code + } + #request_builder_send_code + } + } else { + quote! { + impl RequestBuilder { + #request_builder_setters_code + #request_builder_send_code + } + } + }; tokens.extend(quote! { pub mod #module_name { use super::models; @@ -37,10 +56,7 @@ impl ToTokens for OperationModuleCode { #request_builder_struct_code - impl RequestBuilder { - #request_builder_setters_code - #request_builder_send_code - } + #request_builder_impls #request_builder_intofuture_code } diff --git a/autorust/codegen/src/codegen_operations/operations.rs b/autorust/codegen/src/codegen_operations/operations.rs index a80ba694..66d5b474 100644 --- a/autorust/codegen/src/codegen_operations/operations.rs +++ b/autorust/codegen/src/codegen_operations/operations.rs @@ -1,4 +1,4 @@ -use crate::{content_type, CodeGen, Result}; +use crate::{content_type, CodeGen, Error, ErrorKind, Result}; use super::{ function_code::ClientFunctionCode, @@ -56,12 +56,31 @@ impl OperationCode { let in_operation_group = operation.0.in_group(); let client_function_code = ClientFunctionCode::new(operation, parameters, in_operation_group)?; - let request_builder_struct_code = - RequestBuilderStructCode::new(parameters, in_operation_group, lro, lro_options.clone()); + let generate_blocking = cg.generate_blocking(); + if generate_blocking && (!in_operation_group || operation.pageable().is_some() || lro) { + let operation_id = operation.id().unwrap_or_default().to_owned(); + return Err(Error::with_message(ErrorKind::CodeGen, || { + format!( + "blocking client generation requires operations to be in an operation group, \ + and not pageable or long-running: {operation_id}" + ) + })); + } + let request_builder_struct_code = RequestBuilderStructCode::new( + parameters, + in_operation_group, + lro, + lro_options.clone(), + generate_blocking, + ); let request_builder_setters_code = RequestBuilderSettersCode::new(parameters); let response_code = ResponseCode::new(cg, operation, produces)?; - let request_builder_send_code = - RequestBuilderSendCode::new(new_request_code, request_builder, response_code.clone())?; + let request_builder_send_code = RequestBuilderSendCode::new( + new_request_code, + request_builder, + response_code.clone(), + generate_blocking, + )?; let request_builder_intofuture_code = RequestBuilderIntoFutureCode::new(response_code.clone(), lro, lro_options)?; @@ -72,6 +91,7 @@ impl OperationCode { request_builder_setters_code, request_builder_send_code, request_builder_intofuture_code, + generate_blocking, }; Ok(OperationCode { diff --git a/autorust/codegen/src/codegen_operations/request_builder_send.rs b/autorust/codegen/src/codegen_operations/request_builder_send.rs index 44734d7a..95936815 100644 --- a/autorust/codegen/src/codegen_operations/request_builder_send.rs +++ b/autorust/codegen/src/codegen_operations/request_builder_send.rs @@ -7,7 +7,9 @@ use crate::Result; use crate::{codegen::parse_path_params, identifier::SnakeCaseIdent}; use super::{ - new_request_code::NewRequestCode, response_code::ResponseCode, set_request_code::SetRequestCode, + new_request_code::{verb_to_tokens, AuthCode, NewRequestCode}, + response_code::ResponseCode, + set_request_code::SetRequestCode, }; /// The `send` function of the request builder. pub struct RequestBuilderSendCode { @@ -15,6 +17,7 @@ pub struct RequestBuilderSendCode { request_builder: SetRequestCode, response_code: ResponseCode, url_args: Vec, + generate_blocking: bool, } impl RequestBuilderSendCode { @@ -22,6 +25,7 @@ impl RequestBuilderSendCode { new_request_code: NewRequestCode, request_builder: SetRequestCode, response_code: ResponseCode, + generate_blocking: bool, ) -> Result { let params = parse_path_params(&new_request_code.path); let url_args: Result> = params.iter().map(|s| s.to_snake_case_ident()).collect(); @@ -31,6 +35,7 @@ impl RequestBuilderSendCode { request_builder, response_code, url_args, + generate_blocking, }) } } @@ -82,6 +87,58 @@ impl ToTokens for RequestBuilderSendCode { } }; + if self.generate_blocking { + // Request construction is shared by the async and blocking clients via + // `build_request()`; each client type then has its own `send()`. + // Pageable and long-running operations are rejected in `OperationCode::new`. + let verb = verb_to_tokens(&new_request_code.verb); + let auth = AuthCode {}; + tokens.extend(quote! { + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, #verb); + #request_builder + req.set_body(req_body); + Ok(req) + } + #urlfn + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + #auth + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self.client.token_credential().http_authorization_header_blocking()? { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } + }); + return; + } + let send_future = quote! { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] diff --git a/autorust/codegen/src/codegen_operations/request_builder_struct.rs b/autorust/codegen/src/codegen_operations/request_builder_struct.rs index 154130d2..2c816296 100644 --- a/autorust/codegen/src/codegen_operations/request_builder_struct.rs +++ b/autorust/codegen/src/codegen_operations/request_builder_struct.rs @@ -11,6 +11,7 @@ pub struct RequestBuilderStructCode { in_operation_group: bool, lro: bool, lro_options: Option, + generate_blocking: bool, } impl RequestBuilderStructCode { @@ -19,12 +20,14 @@ impl RequestBuilderStructCode { in_operation_group: bool, lro: bool, lro_options: Option, + generate_blocking: bool, ) -> Self { Self { parameters: parameters.clone(), in_operation_group, lro, lro_options, + generate_blocking, } } } @@ -32,7 +35,11 @@ impl RequestBuilderStructCode { impl ToTokens for RequestBuilderStructCode { fn to_tokens(&self, tokens: &mut TokenStream) { let mut params: Vec = Vec::new(); - if self.in_operation_group { + if self.generate_blocking { + // The request builder is generic over the client type, so that it can + // be created by either the async or the blocking client. + params.push(quote! { pub(crate) client: C }); + } else if self.in_operation_group { params.push(quote! { pub(crate) client: super::super::Client }); } else { params.push(quote! { pub(crate) client: super::Client }); @@ -120,6 +127,20 @@ impl ToTokens for RequestBuilderStructCode { } }; + let (blocking_docs, generics) = if self.generate_blocking { + ( + quote! { + /// + /// When created from a [`blocking::Client`](super::super::blocking::Client), + /// finalize and submit the request using [`RequestBuilder::send()`], which + /// blocks until the request completes. + }, + quote! { }, + ) + } else { + (quote! {}, quote! {}) + }; + tokens.extend(quote! { #[derive(Clone)] /// `RequestBuilder` provides a mechanism for setting optional parameters on a request. @@ -128,7 +149,8 @@ impl ToTokens for RequestBuilderStructCode { /// parameters can be chained. /// #lro_docs - pub struct RequestBuilder { + #blocking_docs + pub struct RequestBuilder #generics { #(#params),* } }); diff --git a/autorust/codegen/src/lib.rs b/autorust/codegen/src/lib.rs index ffc6566d..f07d66f1 100644 --- a/autorust/codegen/src/lib.rs +++ b/autorust/codegen/src/lib.rs @@ -60,6 +60,8 @@ pub struct RunConfig<'a> { pub crate_name_prefix: &'a str, pub runs: Vec, pub print_writing_file: bool, + /// Also generate a blocking (non-async) client for each module. + pub generate_blocking: bool, } impl<'a> RunConfig<'a> { @@ -68,6 +70,7 @@ impl<'a> RunConfig<'a> { crate_name_prefix, runs: vec![Runs::Models, Runs::Operations], print_writing_file: false, + generate_blocking: false, } } } @@ -87,6 +90,9 @@ impl<'a> CrateConfig<'a> { pub fn print_writing_file(&self) -> bool { self.run_config.print_writing_file } + pub fn generate_blocking(&self) -> bool { + self.run_config.generate_blocking + } } #[allow(clippy::ptr_arg)] diff --git a/azure_devops_rust_api/Cargo.toml b/azure_devops_rust_api/Cargo.toml index d6bf192a..a9a22092 100644 --- a/azure_devops_rust_api/Cargo.toml +++ b/azure_devops_rust_api/Cargo.toml @@ -21,7 +21,9 @@ rust-version = "1.80.0" doctest = false [dependencies] -azure_core = { version = "1", default-features = true } +# azure_core's default features (async reqwest transport, tokio) are enabled via this +# crate's `reqwest` feature, so that blocking-only builds can avoid them. +azure_core = { version = "1", default-features = false } serde = { version = "1", features = ["derive"] } serde_json = "1" bytes = "1" @@ -31,6 +33,10 @@ time = "0.3" async-trait = "0.1" tracing = "0.1" once_cell = "1" +ureq = { version = "3", optional = true } +# Blocking reqwest client. `dep:` avoids clashing with the `reqwest` feature, +# which enables azure_core's async reqwest transport. +reqwest = { version = "0.13", optional = true, features = ["blocking"] } # uuid is an indirect dependency that fails to build on wasm32. # See: https://github.com/uuid-rs/uuid/issues/802 @@ -46,7 +52,19 @@ tracing-subscriber = "0.3" [features] default = ["reqwest"] -reqwest = ["azure_core/reqwest"] +# Async HTTP transport (azure_core's default features). +reqwest = [ + "azure_core/reqwest", + "azure_core/reqwest_rustls", + "azure_core/reqwest_gzip", + "azure_core/reqwest_deflate", + "azure_core/tokio", +] +# Blocking (non-async) clients, in each module's `blocking` submodule. +# Enable `ureq` or `reqwest_blocking` to also get an `HttpClient` implementation. +blocking = [] +ureq = ["blocking", "dep:ureq"] +reqwest_blocking = ["blocking", "dep:reqwest"] #reqwest_rustls = ["azure_core/reqwest_rustls"] no-default-tag = [] accounts = [] @@ -277,6 +295,10 @@ required-features = ["wit"] name = "wit_work_item_create" required-features = ["wit"] +[[example]] +name = "wit_work_item_create_blocking" +required-features = ["wit", "ureq"] + [[example]] name = "wit_work_item_get" required-features = ["wit"] @@ -301,6 +323,14 @@ required-features = ["release"] name = "member_entitlement_management" required-features = ["member_entitlement_management"] +[[example]] +name = "git_repo_list_blocking" +required-features = ["git", "ureq"] + +[[example]] +name = "git_repo_list_reqwest_blocking" +required-features = ["git", "reqwest_blocking"] + [[example]] name = "download_artifact" required-features = ["artifacts_download"] diff --git a/azure_devops_rust_api/README.md b/azure_devops_rust_api/README.md index cb452141..a63b84bb 100644 --- a/azure_devops_rust_api/README.md +++ b/azure_devops_rust_api/README.md @@ -164,6 +164,48 @@ cargo run --example download_artifact --features="artifacts_download" -- \ --feed --name --version --path ``` +## Blocking (non-async) API + +Each API module also provides a blocking client, in its `blocking` submodule, for +applications that don't use an async runtime. Requests are sent using an HTTP client that +is supplied when the client is created. Enable the `ureq` or `reqwest_blocking` feature for +a ready-made HTTP client: + +```toml +[dependencies] +azure_devops_rust_api = { version = "0.39.1", default-features = false, features = ["git", "ureq"] } +``` + +Disabling default features removes the async HTTP transport, so that a blocking-only build does +not depend on `tokio`, `hyper` or async `reqwest`. (Note that `reqwest::blocking` uses `tokio` +internally, so this only applies when using `ureq` or your own `HttpClient`.) + +```rust +use azure_devops_rust_api::{blocking::UreqClient, git, Credential}; + +let credential = Credential::from_pat(pat); +let git_client = git::blocking::ClientBuilder::new(credential, UreqClient::new()).build(); + +let repos = git_client + .repositories_client() + .list(organization, project) + .send()? + .into_body()? + .value; +``` + +To use a different HTTP client, implement the `blocking::HttpClient` trait and enable the +`blocking` feature. + +Limitations of the blocking API: +- Only PAT (and unauthenticated) credentials are supported. +- Requests are not sent through the `azure_core` pipeline, so no retry policy is applied. +- The `artifacts_download` module is async-only. + +See [examples/git_repo_list_blocking.rs](examples/git_repo_list_blocking.rs) (ureq), +[examples/git_repo_list_reqwest_blocking.rs](examples/git_repo_list_reqwest_blocking.rs) (reqwest), and +[examples/wit_work_item_create_blocking.rs](examples/wit_work_item_create_blocking.rs) (creating a work item). + ## Examples The [examples/](examples/) directory contains runnable examples for most API areas. diff --git a/azure_devops_rust_api/examples/git_repo_list_blocking.rs b/azure_devops_rust_api/examples/git_repo_list_blocking.rs new file mode 100644 index 00000000..ee5a47a4 --- /dev/null +++ b/azure_devops_rust_api/examples/git_repo_list_blocking.rs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// git_repo_list_blocking.rs +// Repository list example, using the blocking (non-async) API with ureq. +use anyhow::Result; +use azure_devops_rust_api::blocking::UreqClient; +use azure_devops_rust_api::{git, Credential}; +use std::env; + +fn main() -> Result<()> { + // Blocking requests only support PAT authentication + let token = env::var("ADO_TOKEN").expect("Must define ADO_TOKEN"); + let credential = Credential::from_pat(token); + + // Get ADO server configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT"); + + // Create a blocking git client, which sends requests using the supplied HTTP client + let git_client = git::blocking::ClientBuilder::new(credential, UreqClient::new()).build(); + + // Get all repositories in the specified organization/project + let repos = git_client + .repositories_client() + .list(organization, project) + .send()? + .into_body()? + .value; + + for repo in repos.iter() { + println!("{}", repo.name); + } + println!("{} repos found", repos.len()); + + Ok(()) +} diff --git a/azure_devops_rust_api/examples/git_repo_list_reqwest_blocking.rs b/azure_devops_rust_api/examples/git_repo_list_reqwest_blocking.rs new file mode 100644 index 00000000..80d6e448 --- /dev/null +++ b/azure_devops_rust_api/examples/git_repo_list_reqwest_blocking.rs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// git_repo_list_reqwest_blocking.rs +// Repository list example, using the blocking (non-async) API with reqwest. +use anyhow::Result; +use azure_devops_rust_api::blocking::ReqwestBlockingClient; +use azure_devops_rust_api::{git, Credential}; +use std::env; + +fn main() -> Result<()> { + // Blocking requests only support PAT authentication + let token = env::var("ADO_TOKEN").expect("Must define ADO_TOKEN"); + let credential = Credential::from_pat(token); + + // Get ADO server configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT"); + + // Create a blocking git client, which sends requests using the supplied HTTP client + let git_client = + git::blocking::ClientBuilder::new(credential, ReqwestBlockingClient::new()).build(); + + // Get all repositories in the specified organization/project + let repos = git_client + .repositories_client() + .list(organization, project) + .send()? + .into_body()? + .value; + + for repo in repos.iter() { + println!("{}", repo.name); + } + println!("{} repos found", repos.len()); + + Ok(()) +} diff --git a/azure_devops_rust_api/examples/wit_work_item_create_blocking.rs b/azure_devops_rust_api/examples/wit_work_item_create_blocking.rs new file mode 100644 index 00000000..47a6f16c --- /dev/null +++ b/azure_devops_rust_api/examples/wit_work_item_create_blocking.rs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// wit_work_item_create_blocking.rs +// Work Item creation example, using the blocking (non-async) API with ureq. +use anyhow::Result; +use azure_devops_rust_api::blocking::UreqClient; +use azure_devops_rust_api::wit::models::{json_patch_operation::Op, JsonPatchOperation}; +use azure_devops_rust_api::{wit, Credential}; +use serde_json::json; +use std::env; + +fn main() -> Result<()> { + // Blocking requests only support PAT authentication + let token = env::var("ADO_TOKEN").expect("Must define ADO_TOKEN"); + let credential = Credential::from_pat(token); + + // Get ADO configuration via environment variables + let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION"); + let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT"); + + // Create a blocking wit client, which sends requests using the supplied HTTP client + let wit_client = wit::blocking::ClientBuilder::new(credential, UreqClient::new()).build(); + + // Assign the type of work item to create + let work_item_type = "User Story"; + + // Define the title of the work item to be created + let title = JsonPatchOperation { + from: None, + op: Some(Op::Add), + path: Some("/fields/System.Title".to_owned()), + value: Some(json!("Example User Story title")), + }; + + // Each operation lives in a vector, additional elements can be added to fill in other fields + // of a work item (see the comments at the end of wit_work_item_create.rs for some examples) + let body = vec![title]; + + // Create a work item + let work_item = wit_client + .work_items_client() + .create(organization, body, project, work_item_type) + .send()? + .into_body()?; + + println!("{work_item:#?}"); + + Ok(()) +} diff --git a/azure_devops_rust_api/src/accounts/mod.rs b/azure_devops_rust_api/src/accounts/mod.rs index 34daf497..3c81d44f 100644 --- a/azure_devops_rust_api/src/accounts/mod.rs +++ b/azure_devops_rust_api/src/accounts/mod.rs @@ -186,13 +186,17 @@ pub mod accounts { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) owner_id: Option, pub(crate) member_id: Option, pub(crate) properties: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "ID for the owner of the accounts."] pub fn owner_id(mut self, owner_id: impl Into) -> Self { self.owner_id = Some(owner_id.into()); @@ -207,6 +211,48 @@ pub mod accounts { self.properties = Some(properties.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(owner_id) = &this.owner_id { + req.url_mut() + .query_pairs_mut() + .append_pair("ownerId", owner_id); + } + if let Some(member_id) = &this.member_id { + req.url_mut() + .query_pairs_mut() + .append_pair("memberId", member_id); + } + if let Some(properties) = &this.properties { + req.url_mut() + .query_pairs_mut() + .append_pair("properties", properties); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -215,9 +261,7 @@ pub mod accounts { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -229,38 +273,24 @@ pub mod accounts { auth_header, ); } - if let Some(owner_id) = &this.owner_id { - req.url_mut() - .query_pairs_mut() - .append_pair("ownerId", owner_id); - } - if let Some(member_id) = &this.member_id { - req.url_mut() - .query_pairs_mut() - .append_pair("memberId", member_id); - } - if let Some(properties) = &this.properties { - req.url_mut() - .query_pairs_mut() - .append_pair("properties", properties); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -277,3 +307,103 @@ pub mod accounts { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn accounts_client(&self) -> accounts::Client { + accounts::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod accounts { + use super::super::accounts::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of accounts for a specific owner or a specific member. One of the following parameters is required: ownerId, memberId."] + #[doc = ""] + #[doc = "See [`list`](super::super::accounts::Client::list) for details of the arguments."] + pub fn list(&self) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + owner_id: None, + member_id: None, + properties: None, + } + } + } + } +} 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 3c6cbca3..f6a688ab 100644 --- a/azure_devops_rust_api/src/approvals_and_checks/mod.rs +++ b/azure_devops_rust_api/src/approvals_and_checks/mod.rs @@ -249,12 +249,45 @@ pub mod pipeline_permissions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/pipelinepermissions", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -264,9 +297,7 @@ pub mod pipeline_permissions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -278,26 +309,24 @@ pub mod pipeline_permissions { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/pipelinepermissions", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -351,13 +380,47 @@ pub mod pipeline_permissions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) resource_type: String, pub(crate) resource_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/pipelinepermissions/{}/{}", + self.client.endpoint(), + self.organization, + self.project, + self.resource_type, + self.resource_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -367,9 +430,7 @@ pub mod pipeline_permissions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -381,27 +442,24 @@ pub mod pipeline_permissions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/pipelinepermissions/{}/{}", - self.client.endpoint(), - self.organization, - self.project, - self.resource_type, - self.resource_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -455,14 +513,49 @@ pub mod pipeline_permissions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ResourcePipelinePermissions, pub(crate) project: String, pub(crate) resource_type: String, pub(crate) resource_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/pipelinepermissions/{}/{}", + self.client.endpoint(), + self.organization, + self.project, + self.resource_type, + self.resource_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -472,9 +565,7 @@ pub mod pipeline_permissions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -486,28 +577,24 @@ pub mod pipeline_permissions { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/pipelinepermissions/{}/{}", - self.client.endpoint(), - self.organization, - self.project, - self.resource_type, - self.resource_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -688,15 +775,19 @@ pub mod check_configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) resource_type: Option, pub(crate) resource_id: Option, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "resource type"] pub fn resource_type(mut self, resource_type: impl Into) -> Self { self.resource_type = Some(resource_type.into()); @@ -714,6 +805,50 @@ pub mod check_configurations { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(resource_type) = &this.resource_type { + req.url_mut() + .query_pairs_mut() + .append_pair("resourceType", resource_type); + } + if let Some(resource_id) = &this.resource_id { + req.url_mut() + .query_pairs_mut() + .append_pair("resourceId", resource_id); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/configurations", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -722,9 +857,7 @@ pub mod check_configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -736,40 +869,24 @@ pub mod check_configurations { auth_header, ); } - if let Some(resource_type) = &this.resource_type { - req.url_mut() - .query_pairs_mut() - .append_pair("resourceType", resource_type); - } - if let Some(resource_id) = &this.resource_id { - req.url_mut() - .query_pairs_mut() - .append_pair("resourceId", resource_id); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/configurations", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -820,12 +937,45 @@ pub mod check_configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CheckConfiguration, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/configurations", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -835,9 +985,7 @@ pub mod check_configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -849,26 +997,24 @@ pub mod check_configurations { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/configurations", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -918,14 +1064,18 @@ pub mod check_configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) id: i32, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn expand( mut self, expand: impl Into, @@ -933,6 +1083,41 @@ pub mod check_configurations { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/configurations/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -941,9 +1126,7 @@ pub mod check_configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -955,31 +1138,24 @@ pub mod check_configurations { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/configurations/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1029,13 +1205,47 @@ pub mod check_configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CheckConfiguration, pub(crate) project: String, pub(crate) id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/configurations/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1045,9 +1255,7 @@ pub mod check_configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1059,27 +1267,24 @@ pub mod check_configurations { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/configurations/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1124,40 +1329,28 @@ pub mod check_configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) id: i32, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -1175,6 +1368,47 @@ pub mod check_configurations { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result<()>; type IntoFuture = BoxFuture<'static, azure_core::Result<()>>; @@ -1228,14 +1462,18 @@ pub mod check_configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The properties that should be expanded in the list of check configurations."] pub fn expand( mut self, @@ -1244,6 +1482,41 @@ pub mod check_configurations { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/queryconfigurations", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1252,9 +1525,7 @@ pub mod check_configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1266,31 +1537,24 @@ pub mod check_configurations { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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.to_string()); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/queryconfigurations", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1389,18 +1653,57 @@ pub mod check_evaluations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CheckSuiteRequest, pub(crate) project: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/runs", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1409,9 +1712,7 @@ pub mod check_evaluations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1423,31 +1724,24 @@ pub mod check_evaluations { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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.to_string()); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/runs", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1497,18 +1791,57 @@ pub mod check_evaluations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) check_suite_id: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/checks/runs/{}", + self.client.endpoint(), + self.organization, + self.project, + self.check_suite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1517,9 +1850,7 @@ pub mod check_evaluations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1531,31 +1862,24 @@ pub mod check_evaluations { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/checks/runs/{}", - self.client.endpoint(), - self.organization, - self.project, - self.check_suite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1674,8 +1998,12 @@ pub mod approvals { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) approval_ids: Option, @@ -1684,7 +2012,7 @@ pub mod approvals { pub(crate) state: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "List of approval Ids to get."] pub fn approval_ids(mut self, approval_ids: impl Into) -> Self { self.approval_ids = Some(approval_ids.into()); @@ -1713,6 +2041,60 @@ pub mod approvals { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(approval_ids) = &this.approval_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("approvalIds", approval_ids); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + if let Some(user_ids) = &this.user_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("userIds", user_ids); + } + if let Some(state) = &this.state { + req.url_mut() + .query_pairs_mut() + .append_pair("state", &state.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/approvals", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1721,9 +2103,7 @@ pub mod approvals { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1735,50 +2115,24 @@ pub mod approvals { auth_header, ); } - if let Some(approval_ids) = &this.approval_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("approvalIds", approval_ids); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - if let Some(user_ids) = &this.user_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("userIds", user_ids); - } - if let Some(state) = &this.state { - req.url_mut() - .query_pairs_mut() - .append_pair("state", &state.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("top", &top.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/approvals", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1828,12 +2182,45 @@ pub mod approvals { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/approvals", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1843,9 +2230,7 @@ pub mod approvals { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1857,26 +2242,24 @@ pub mod approvals { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/approvals", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1926,14 +2309,18 @@ pub mod approvals { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) approval_id: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn expand( mut self, expand: impl Into, @@ -1941,6 +2328,41 @@ pub mod approvals { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/approvals/{}", + self.client.endpoint(), + self.organization, + self.project, + self.approval_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1949,9 +2371,7 @@ pub mod approvals { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1963,31 +2383,24 @@ pub mod approvals { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/approvals/{}", - self.client.endpoint(), - self.organization, - self.project, - self.approval_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2004,3 +2417,365 @@ pub mod approvals { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn approvals_client(&self) -> approvals::Client { + approvals::Client(self.clone()) + } + pub fn check_configurations_client(&self) -> check_configurations::Client { + check_configurations::Client(self.clone()) + } + pub fn check_evaluations_client(&self) -> check_evaluations::Client { + check_evaluations::Client(self.clone()) + } + pub fn pipeline_permissions_client(&self) -> pipeline_permissions::Client { + pipeline_permissions::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod pipeline_permissions { + use super::super::models; + use super::super::pipeline_permissions::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Batch API to authorize/unauthorize a list of definitions for a multiple resources."] + #[doc = ""] + #[doc = "See [`update_pipeline_permisions_for_resources`](super::super::pipeline_permissions::Client::update_pipeline_permisions_for_resources) for details of the arguments."] + pub fn update_pipeline_permisions_for_resources( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + ) -> update_pipeline_permisions_for_resources::RequestBuilder + { + update_pipeline_permisions_for_resources::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + } + } + #[doc = "Given a ResourceType and ResourceId, returns authorized definitions for that resource."] + #[doc = ""] + #[doc = "See [`get`](super::super::pipeline_permissions::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + resource_type: impl Into, + resource_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + resource_type: resource_type.into(), + resource_id: resource_id.into(), + } + } + #[doc = "Authorizes/Unauthorizes a list of definitions for a given resource."] + #[doc = ""] + #[doc = "See [`update_pipeline_permisions_for_resource`](super::super::pipeline_permissions::Client::update_pipeline_permisions_for_resource) for details of the arguments."] + pub fn update_pipeline_permisions_for_resource( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + resource_type: impl Into, + resource_id: impl Into, + ) -> update_pipeline_permisions_for_resource::RequestBuilder + { + update_pipeline_permisions_for_resource::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + resource_type: resource_type.into(), + resource_id: resource_id.into(), + } + } + } + } + pub mod check_configurations { + use super::super::check_configurations::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get Check configuration by resource type and id"] + #[doc = ""] + #[doc = "See [`list`](super::super::check_configurations::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + resource_type: None, + resource_id: None, + expand: None, + } + } + #[doc = "Add a check configuration"] + #[doc = ""] + #[doc = "See [`add`](super::super::check_configurations::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get Check configuration by Id"] + #[doc = ""] + #[doc = "See [`get`](super::super::check_configurations::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + id, + expand: None, + } + } + #[doc = "Update check configuration"] + #[doc = ""] + #[doc = "See [`update`](super::super::check_configurations::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + id, + } + } + #[doc = "Delete check configuration by id"] + #[doc = ""] + #[doc = "See [`delete`](super::super::check_configurations::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + id, + } + } + #[doc = "Get check configurations for multiple resources by resource type and id."] + #[doc = ""] + #[doc = "See [`query`](super::super::check_configurations::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + expand: None, + } + } + } + } + pub mod check_evaluations { + use super::super::check_evaluations::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Initiate an evaluation for a check in a pipeline"] + #[doc = ""] + #[doc = "See [`evaluate`](super::super::check_evaluations::Client::evaluate) for details of the arguments."] + pub fn evaluate( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> evaluate::RequestBuilder { + evaluate::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + expand: None, + } + } + #[doc = "Get details for a specific check evaluation"] + #[doc = ""] + #[doc = "See [`get`](super::super::check_evaluations::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + check_suite_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + check_suite_id: check_suite_id.into(), + expand: None, + } + } + } + } + pub mod approvals { + use super::super::approvals::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List Approvals. This can be used to get a set of pending approvals in a pipeline, on an user or for a resource.."] + #[doc = ""] + #[doc = "See [`query`](super::super::approvals::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + project: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + approval_ids: None, + expand: None, + user_ids: None, + state: None, + top: None, + } + } + #[doc = "Update approvals."] + #[doc = ""] + #[doc = "See [`update`](super::super::approvals::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + } + } + #[doc = "Get an approval."] + #[doc = ""] + #[doc = "See [`get`](super::super::approvals::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + approval_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + approval_id: approval_id.into(), + expand: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/artifacts/mod.rs b/azure_devops_rust_api/src/artifacts/mod.rs index 568e851d..6b3bb7f6 100644 --- a/azure_devops_rust_api/src/artifacts/mod.rs +++ b/azure_devops_rust_api/src/artifacts/mod.rs @@ -228,17 +228,54 @@ pub mod service_settings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) include_ids: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to add IdentityIds to the permission objects."] pub fn include_ids(mut self, include_ids: bool) -> Self { self.include_ids = Some(include_ids); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -247,9 +284,7 @@ pub mod service_settings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -261,29 +296,24 @@ pub mod service_settings { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -333,11 +363,43 @@ pub mod service_settings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -347,9 +409,7 @@ pub mod service_settings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -361,25 +421,24 @@ pub mod service_settings { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -498,15 +557,19 @@ pub mod change_tracking { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) include_deleted: Option, pub(crate) continuation_token: Option, pub(crate) batch_size: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If true, get changes for all feeds including deleted feeds. The default value is false."] pub fn include_deleted(mut self, include_deleted: bool) -> Self { self.include_deleted = Some(include_deleted); @@ -522,6 +585,50 @@ pub mod change_tracking { self.batch_size = Some(batch_size); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_deleted) = &this.include_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDeleted", &include_deleted.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", &continuation_token.to_string()); + } + if let Some(batch_size) = &this.batch_size { + req.url_mut() + .query_pairs_mut() + .append_pair("batchSize", &batch_size.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feedchanges", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -530,9 +637,7 @@ pub mod change_tracking { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -544,40 +649,24 @@ pub mod change_tracking { auth_header, ); } - if let Some(include_deleted) = &this.include_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("includeDeleted", &include_deleted.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", &continuation_token.to_string()); - } - if let Some(batch_size) = &this.batch_size { - req.url_mut() - .query_pairs_mut() - .append_pair("batchSize", &batch_size.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feedchanges", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -627,12 +716,45 @@ pub mod change_tracking { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feedchanges/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -642,9 +764,7 @@ pub mod change_tracking { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -656,26 +776,24 @@ pub mod change_tracking { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feedchanges/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -728,15 +846,19 @@ pub mod change_tracking { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) project: String, pub(crate) continuation_token: Option, pub(crate) batch_size: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A continuation token which acts as a bookmark to a previously retrieved change. This token allows the user to continue retrieving changes in batches, picking up where the previous batch left off. If specified, all the changes that occur strictly after the token will be returned. If not specified or 0, iteration will start with the first change."] pub fn continuation_token(mut self, continuation_token: i64) -> Self { self.continuation_token = Some(continuation_token); @@ -747,6 +869,46 @@ pub mod change_tracking { self.batch_size = Some(batch_size); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", &continuation_token.to_string()); + } + if let Some(batch_size) = &this.batch_size { + req.url_mut() + .query_pairs_mut() + .append_pair("batchSize", &batch_size.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/packagechanges", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -755,9 +917,7 @@ pub mod change_tracking { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -769,36 +929,24 @@ pub mod change_tracking { auth_header, ); } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", &continuation_token.to_string()); - } - if let Some(batch_size) = &this.batch_size { - req.url_mut() - .query_pairs_mut() - .append_pair("batchSize", &batch_size.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/packagechanges", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -909,11 +1057,43 @@ pub mod feed_recycle_bin { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feedrecyclebin", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -923,9 +1103,7 @@ pub mod feed_recycle_bin { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -937,25 +1115,24 @@ pub mod feed_recycle_bin { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feedrecyclebin", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1000,13 +1177,47 @@ pub mod feed_recycle_bin { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::JsonPatchDocument, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feedrecyclebin/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1016,9 +1227,7 @@ pub mod feed_recycle_bin { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1030,27 +1239,24 @@ pub mod feed_recycle_bin { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feedrecyclebin/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1098,40 +1304,28 @@ pub mod feed_recycle_bin { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) project: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -1149,6 +1343,47 @@ pub mod feed_recycle_bin { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result<()>; type IntoFuture = BoxFuture<'static, azure_core::Result<()>>; @@ -1463,15 +1698,19 @@ pub mod feed_management { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) feed_role: Option, pub(crate) include_deleted_upstreams: Option, pub(crate) include_urls: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Filter by this role, either Administrator(4), Contributor(3), or Reader(2) level permissions."] pub fn feed_role(mut self, feed_role: impl Into) -> Self { self.feed_role = Some(feed_role.into()); @@ -1487,6 +1726,51 @@ pub mod feed_management { self.include_urls = Some(include_urls); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(feed_role) = &this.feed_role { + req.url_mut() + .query_pairs_mut() + .append_pair("feedRole", &feed_role.to_string()); + } + if let Some(include_deleted_upstreams) = &this.include_deleted_upstreams { + req.url_mut().query_pairs_mut().append_pair( + "includeDeletedUpstreams", + &include_deleted_upstreams.to_string(), + ); + } + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1495,9 +1779,7 @@ pub mod feed_management { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1509,41 +1791,24 @@ pub mod feed_management { auth_header, ); } - if let Some(feed_role) = &this.feed_role { - req.url_mut() - .query_pairs_mut() - .append_pair("feedRole", &feed_role.to_string()); - } - if let Some(include_deleted_upstreams) = &this.include_deleted_upstreams { - req.url_mut().query_pairs_mut().append_pair( - "includeDeletedUpstreams", - &include_deleted_upstreams.to_string(), - ); - } - 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1591,12 +1856,45 @@ pub mod feed_management { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Feed, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1606,9 +1904,7 @@ pub mod feed_management { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1620,26 +1916,24 @@ pub mod feed_management { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1687,19 +1981,59 @@ pub mod feed_management { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) project: String, pub(crate) include_deleted_upstreams: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Include upstreams that have been deleted in the response."] pub fn include_deleted_upstreams(mut self, include_deleted_upstreams: bool) -> Self { self.include_deleted_upstreams = Some(include_deleted_upstreams); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_deleted_upstreams) = &this.include_deleted_upstreams { + req.url_mut().query_pairs_mut().append_pair( + "includeDeletedUpstreams", + &include_deleted_upstreams.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1708,9 +2042,7 @@ pub mod feed_management { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1722,32 +2054,24 @@ pub mod feed_management { auth_header, ); } - if let Some(include_deleted_upstreams) = &this.include_deleted_upstreams { - req.url_mut().query_pairs_mut().append_pair( - "includeDeletedUpstreams", - &include_deleted_upstreams.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1795,13 +2119,47 @@ pub mod feed_management { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::FeedUpdate, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1811,9 +2169,7 @@ pub mod feed_management { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1825,27 +2181,24 @@ pub mod feed_management { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1890,12 +2243,45 @@ pub mod feed_management { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1905,9 +2291,7 @@ pub mod feed_management { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1919,26 +2303,24 @@ pub mod feed_management { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1991,8 +2373,12 @@ pub mod feed_management { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) project: String, @@ -2001,7 +2387,7 @@ pub mod feed_management { pub(crate) identity_descriptor: Option, pub(crate) include_deleted_feeds: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to include user Ids in the response. Default is false."] pub fn include_ids(mut self, include_ids: bool) -> Self { self.include_ids = Some(include_ids); @@ -2025,6 +2411,57 @@ pub mod feed_management { self.include_deleted_feeds = Some(include_deleted_feeds); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_ids) = &this.include_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("includeIds", &include_ids.to_string()); + } + if let Some(exclude_inherited_permissions) = &this.exclude_inherited_permissions { + req.url_mut().query_pairs_mut().append_pair( + "excludeInheritedPermissions", + &exclude_inherited_permissions.to_string(), + ); + } + if let Some(identity_descriptor) = &this.identity_descriptor { + req.url_mut() + .query_pairs_mut() + .append_pair("identityDescriptor", identity_descriptor); + } + if let Some(include_deleted_feeds) = &this.include_deleted_feeds { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDeletedFeeds", &include_deleted_feeds.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/permissions", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2033,9 +2470,7 @@ pub mod feed_management { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2047,50 +2482,24 @@ pub mod feed_management { auth_header, ); } - if let Some(include_ids) = &this.include_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("includeIds", &include_ids.to_string()); - } - if let Some(exclude_inherited_permissions) = - &this.exclude_inherited_permissions - { - req.url_mut().query_pairs_mut().append_pair( - "excludeInheritedPermissions", - &exclude_inherited_permissions.to_string(), - ); - } - if let Some(identity_descriptor) = &this.identity_descriptor { - req.url_mut() - .query_pairs_mut() - .append_pair("identityDescriptor", identity_descriptor); - } - if let Some(include_deleted_feeds) = &this.include_deleted_feeds { - req.url_mut().query_pairs_mut().append_pair( - "includeDeletedFeeds", - &include_deleted_feeds.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/permissions", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2140,13 +2549,47 @@ pub mod feed_management { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/permissions", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2156,9 +2599,7 @@ pub mod feed_management { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2170,27 +2611,24 @@ pub mod feed_management { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/permissions", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2240,12 +2678,45 @@ pub mod feed_management { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/views", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2255,9 +2726,7 @@ pub mod feed_management { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2269,26 +2738,24 @@ pub mod feed_management { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/views", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2338,13 +2805,47 @@ pub mod feed_management { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::FeedView, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/views", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2354,9 +2855,7 @@ pub mod feed_management { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2368,27 +2867,24 @@ pub mod feed_management { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/views", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2438,13 +2934,47 @@ pub mod feed_management { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) view_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.view_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2454,9 +2984,7 @@ pub mod feed_management { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2468,27 +2996,24 @@ pub mod feed_management { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.view_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2538,14 +3063,49 @@ pub mod feed_management { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::FeedView, pub(crate) feed_id: String, pub(crate) view_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.view_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2555,9 +3115,7 @@ pub mod feed_management { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2569,28 +3127,24 @@ pub mod feed_management { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.view_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2635,13 +3189,47 @@ pub mod feed_management { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) view_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.view_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2651,9 +3239,7 @@ pub mod feed_management { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2665,27 +3251,24 @@ pub mod feed_management { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/views/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.view_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2947,13 +3530,47 @@ pub mod artifact_details { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PackageMetricsQuery, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/packagemetricsbatch", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2963,9 +3580,7 @@ pub mod artifact_details { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2977,27 +3592,24 @@ pub mod artifact_details { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/packagemetricsbatch", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3047,8 +3659,12 @@ pub mod artifact_details { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) project: String, @@ -3067,7 +3683,7 @@ pub mod artifact_details { pub(crate) is_cached: Option, pub(crate) direct_upstream_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "One of the supported artifact package types."] pub fn protocol_type(mut self, protocol_type: impl Into) -> Self { self.protocol_type = Some(protocol_type.into()); @@ -3141,106 +3757,89 @@ pub mod artifact_details { self.direct_upstream_id = Some(direct_upstream_id.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - if let Some(protocol_type) = &this.protocol_type { - req.url_mut() - .query_pairs_mut() - .append_pair("protocolType", protocol_type); - } - if let Some(package_name_query) = &this.package_name_query { - req.url_mut() - .query_pairs_mut() - .append_pair("packageNameQuery", package_name_query); - } - if let Some(normalized_package_name) = &this.normalized_package_name { - req.url_mut() - .query_pairs_mut() - .append_pair("normalizedPackageName", normalized_package_name); - } - if let Some(include_urls) = &this.include_urls { - req.url_mut() - .query_pairs_mut() - .append_pair("includeUrls", &include_urls.to_string()); - } - if let Some(include_all_versions) = &this.include_all_versions { - req.url_mut().query_pairs_mut().append_pair( - "includeAllVersions", - &include_all_versions.to_string(), - ); - } - if let Some(is_listed) = &this.is_listed { - req.url_mut() - .query_pairs_mut() - .append_pair("isListed", &is_listed.to_string()); - } - if let Some(get_top_package_versions) = &this.get_top_package_versions { - req.url_mut().query_pairs_mut().append_pair( - "getTopPackageVersions", - &get_top_package_versions.to_string(), - ); - } - if let Some(is_release) = &this.is_release { - req.url_mut() - .query_pairs_mut() - .append_pair("isRelease", &is_release.to_string()); - } - if let Some(include_description) = &this.include_description { - req.url_mut().query_pairs_mut().append_pair( - "includeDescription", - &include_description.to_string(), - ); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(include_deleted) = &this.include_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("includeDeleted", &include_deleted.to_string()); - } - if let Some(is_cached) = &this.is_cached { - req.url_mut() - .query_pairs_mut() - .append_pair("isCached", &is_cached.to_string()); - } - if let Some(direct_upstream_id) = &this.direct_upstream_id { - req.url_mut() - .query_pairs_mut() - .append_pair("directUpstreamId", direct_upstream_id); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(protocol_type) = &this.protocol_type { + req.url_mut() + .query_pairs_mut() + .append_pair("protocolType", protocol_type); + } + if let Some(package_name_query) = &this.package_name_query { + req.url_mut() + .query_pairs_mut() + .append_pair("packageNameQuery", package_name_query); + } + if let Some(normalized_package_name) = &this.normalized_package_name { + req.url_mut() + .query_pairs_mut() + .append_pair("normalizedPackageName", normalized_package_name); + } + if let Some(include_urls) = &this.include_urls { + req.url_mut() + .query_pairs_mut() + .append_pair("includeUrls", &include_urls.to_string()); + } + if let Some(include_all_versions) = &this.include_all_versions { + req.url_mut() + .query_pairs_mut() + .append_pair("includeAllVersions", &include_all_versions.to_string()); + } + if let Some(is_listed) = &this.is_listed { + req.url_mut() + .query_pairs_mut() + .append_pair("isListed", &is_listed.to_string()); + } + if let Some(get_top_package_versions) = &this.get_top_package_versions { + req.url_mut().query_pairs_mut().append_pair( + "getTopPackageVersions", + &get_top_package_versions.to_string(), + ); + } + if let Some(is_release) = &this.is_release { + req.url_mut() + .query_pairs_mut() + .append_pair("isRelease", &is_release.to_string()); + } + if let Some(include_description) = &this.include_description { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDescription", &include_description.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(include_deleted) = &this.include_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDeleted", &include_deleted.to_string()); + } + if let Some(is_cached) = &this.is_cached { + req.url_mut() + .query_pairs_mut() + .append_pair("isCached", &is_cached.to_string()); + } + if let Some(direct_upstream_id) = &this.direct_upstream_id { + req.url_mut() + .query_pairs_mut() + .append_pair("directUpstreamId", direct_upstream_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -3258,6 +3857,47 @@ pub mod artifact_details { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -3305,8 +3945,12 @@ pub mod artifact_details { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_id: String, @@ -3318,7 +3962,7 @@ pub mod artifact_details { pub(crate) include_deleted: Option, pub(crate) include_description: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to return all versions of the package in the response. Default is false (latest version only)."] pub fn include_all_versions(mut self, include_all_versions: bool) -> Self { self.include_all_versions = Some(include_all_versions); @@ -3349,6 +3993,67 @@ pub mod artifact_details { self.include_description = Some(include_description); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_all_versions) = &this.include_all_versions { + req.url_mut() + .query_pairs_mut() + .append_pair("includeAllVersions", &include_all_versions.to_string()); + } + if let Some(include_urls) = &this.include_urls { + req.url_mut() + .query_pairs_mut() + .append_pair("includeUrls", &include_urls.to_string()); + } + if let Some(is_listed) = &this.is_listed { + req.url_mut() + .query_pairs_mut() + .append_pair("isListed", &is_listed.to_string()); + } + if let Some(is_release) = &this.is_release { + req.url_mut() + .query_pairs_mut() + .append_pair("isRelease", &is_release.to_string()); + } + if let Some(include_deleted) = &this.include_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDeleted", &include_deleted.to_string()); + } + if let Some(include_description) = &this.include_description { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDescription", &include_description.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/packages/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3357,9 +4062,7 @@ pub mod artifact_details { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3371,59 +4074,24 @@ pub mod artifact_details { auth_header, ); } - if let Some(include_all_versions) = &this.include_all_versions { - req.url_mut().query_pairs_mut().append_pair( - "includeAllVersions", - &include_all_versions.to_string(), - ); - } - if let Some(include_urls) = &this.include_urls { - req.url_mut() - .query_pairs_mut() - .append_pair("includeUrls", &include_urls.to_string()); - } - if let Some(is_listed) = &this.is_listed { - req.url_mut() - .query_pairs_mut() - .append_pair("isListed", &is_listed.to_string()); - } - if let Some(is_release) = &this.is_release { - req.url_mut() - .query_pairs_mut() - .append_pair("isRelease", &is_release.to_string()); - } - if let Some(include_deleted) = &this.include_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("includeDeleted", &include_deleted.to_string()); - } - if let Some(include_description) = &this.include_description { - req.url_mut().query_pairs_mut().append_pair( - "includeDescription", - &include_description.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/packages/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3476,14 +4144,49 @@ pub mod artifact_details { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PackageVersionMetricsQuery, pub(crate) feed_id: String, pub(crate) package_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versionmetricsbatch", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3493,9 +4196,7 @@ pub mod artifact_details { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3507,28 +4208,24 @@ pub mod artifact_details { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versionmetricsbatch", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3579,8 +4276,12 @@ pub mod artifact_details { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_id: String, @@ -3589,7 +4290,7 @@ pub mod artifact_details { pub(crate) is_listed: Option, pub(crate) is_deleted: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to include urls for each version. Default is true."] pub fn include_urls(mut self, include_urls: bool) -> Self { self.include_urls = Some(include_urls); @@ -3605,6 +4306,52 @@ pub mod artifact_details { self.is_deleted = Some(is_deleted); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_urls) = &this.include_urls { + req.url_mut() + .query_pairs_mut() + .append_pair("includeUrls", &include_urls.to_string()); + } + if let Some(is_listed) = &this.is_listed { + req.url_mut() + .query_pairs_mut() + .append_pair("isListed", &is_listed.to_string()); + } + if let Some(is_deleted) = &this.is_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("isDeleted", &is_deleted.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versions", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3613,9 +4360,7 @@ pub mod artifact_details { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3627,42 +4372,24 @@ pub mod artifact_details { auth_header, ); } - if let Some(include_urls) = &this.include_urls { - req.url_mut() - .query_pairs_mut() - .append_pair("includeUrls", &include_urls.to_string()); - } - if let Some(is_listed) = &this.is_listed { - req.url_mut() - .query_pairs_mut() - .append_pair("isListed", &is_listed.to_string()); - } - if let Some(is_deleted) = &this.is_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("isDeleted", &is_deleted.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versions", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3712,8 +4439,12 @@ pub mod artifact_details { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_id: String, @@ -3723,7 +4454,7 @@ pub mod artifact_details { pub(crate) is_listed: Option, pub(crate) is_deleted: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to include urls for each version. Default is true."] pub fn include_urls(mut self, include_urls: bool) -> Self { self.include_urls = Some(include_urls); @@ -3739,6 +4470,53 @@ pub mod artifact_details { self.is_deleted = Some(is_deleted); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_urls) = &this.include_urls { + req.url_mut() + .query_pairs_mut() + .append_pair("includeUrls", &include_urls.to_string()); + } + if let Some(is_listed) = &this.is_listed { + req.url_mut() + .query_pairs_mut() + .append_pair("isListed", &is_listed.to_string()); + } + if let Some(is_deleted) = &this.is_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("isDeleted", &is_deleted.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_id, + self.package_version_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3747,9 +4525,7 @@ pub mod artifact_details { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3761,43 +4537,24 @@ pub mod artifact_details { auth_header, ); } - if let Some(include_urls) = &this.include_urls { - req.url_mut() - .query_pairs_mut() - .append_pair("includeUrls", &include_urls.to_string()); - } - if let Some(is_listed) = &this.is_listed { - req.url_mut() - .query_pairs_mut() - .append_pair("isListed", &is_listed.to_string()); - } - if let Some(is_deleted) = &this.is_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("isDeleted", &is_deleted.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/Packages/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_id, - self.package_version_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3850,42 +4607,30 @@ pub mod artifact_details { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_id: String, pub(crate) package_version_id: String, pub(crate) project: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -3905,6 +4650,47 @@ pub mod artifact_details { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = @@ -3951,13 +4737,47 @@ pub mod artifact_details { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/public/packaging/Feeds/{}/Packages/{}/badge", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3967,9 +4787,7 @@ pub mod artifact_details { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3981,27 +4799,24 @@ pub mod artifact_details { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/public/packaging/Feeds/{}/Packages/{}/badge", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4177,8 +4992,12 @@ pub mod recycle_bin { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) project: String, @@ -4189,7 +5008,7 @@ pub mod recycle_bin { pub(crate) skip: Option, pub(crate) include_all_versions: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Type of package (e.g. NuGet, npm, ...)."] pub fn protocol_type(mut self, protocol_type: impl Into) -> Self { self.protocol_type = Some(protocol_type.into()); @@ -4220,6 +5039,66 @@ pub mod recycle_bin { self.include_all_versions = Some(include_all_versions); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(protocol_type) = &this.protocol_type { + req.url_mut() + .query_pairs_mut() + .append_pair("protocolType", protocol_type); + } + if let Some(package_name_query) = &this.package_name_query { + req.url_mut() + .query_pairs_mut() + .append_pair("packageNameQuery", package_name_query); + } + if let Some(include_urls) = &this.include_urls { + req.url_mut() + .query_pairs_mut() + .append_pair("includeUrls", &include_urls.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(include_all_versions) = &this.include_all_versions { + req.url_mut() + .query_pairs_mut() + .append_pair("includeAllVersions", &include_all_versions.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4228,9 +5107,7 @@ pub mod recycle_bin { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4242,57 +5119,24 @@ pub mod recycle_bin { auth_header, ); } - if let Some(protocol_type) = &this.protocol_type { - req.url_mut() - .query_pairs_mut() - .append_pair("protocolType", protocol_type); - } - if let Some(package_name_query) = &this.package_name_query { - req.url_mut() - .query_pairs_mut() - .append_pair("packageNameQuery", package_name_query); - } - if let Some(include_urls) = &this.include_urls { - req.url_mut() - .query_pairs_mut() - .append_pair("includeUrls", &include_urls.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(include_all_versions) = &this.include_all_versions { - req.url_mut().query_pairs_mut().append_pair( - "includeAllVersions", - &include_all_versions.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4342,12 +5186,45 @@ pub mod recycle_bin { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4357,9 +5234,7 @@ pub mod recycle_bin { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4371,26 +5246,24 @@ pub mod recycle_bin { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4440,20 +5313,60 @@ pub mod recycle_bin { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_id: String, pub(crate) project: String, pub(crate) include_urls: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to return REST Urls with the response. Default is True."] pub fn include_urls(mut self, include_urls: bool) -> Self { self.include_urls = Some(include_urls); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4462,9 +5375,7 @@ pub mod recycle_bin { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4476,32 +5387,24 @@ pub mod recycle_bin { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4554,20 +5457,60 @@ pub mod recycle_bin { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_id: String, pub(crate) project: String, pub(crate) include_urls: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to return REST Urls with the response. Default is True."] pub fn include_urls(mut self, include_urls: bool) -> Self { self.include_urls = Some(include_urls); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages/{}/Versions", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4576,9 +5519,7 @@ pub mod recycle_bin { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4590,32 +5531,24 @@ pub mod recycle_bin { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/RecycleBin/Packages/{}/Versions", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4669,8 +5602,12 @@ pub mod recycle_bin { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_id: String, @@ -4678,44 +5615,29 @@ pub mod recycle_bin { pub(crate) project: String, pub(crate) include_urls: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to return REST Urls with the response. Default is True."] pub fn include_urls(mut self, include_urls: bool) -> Self { self.include_urls = Some(include_urls); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - 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::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -4735,6 +5657,47 @@ pub mod recycle_bin { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = @@ -4853,12 +5816,45 @@ pub mod retention_policies { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4868,9 +5864,7 @@ pub mod retention_policies { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4882,26 +5876,24 @@ pub mod retention_policies { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4951,13 +5943,47 @@ pub mod retention_policies { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::FeedRetentionPolicy, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4967,9 +5993,7 @@ pub mod retention_policies { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4981,27 +6005,24 @@ pub mod retention_policies { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5046,12 +6067,45 @@ pub mod retention_policies { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5061,9 +6115,7 @@ pub mod retention_policies { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5075,26 +6127,24 @@ pub mod retention_policies { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/Feeds/{}/retentionpolicies", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5179,13 +6229,47 @@ pub mod provenance { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::SessionRequest, pub(crate) protocol: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/provenance/session/{}", + self.client.endpoint(), + self.organization, + self.project, + self.protocol + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5195,9 +6279,7 @@ pub mod provenance { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5209,27 +6291,24 @@ pub mod provenance { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/provenance/session/{}", - self.client.endpoint(), - self.organization, - self.project, - self.protocol - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5246,3 +6325,831 @@ pub mod provenance { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn artifact_details_client(&self) -> artifact_details::Client { + artifact_details::Client(self.clone()) + } + pub fn change_tracking_client(&self) -> change_tracking::Client { + change_tracking::Client(self.clone()) + } + pub fn feed_management_client(&self) -> feed_management::Client { + feed_management::Client(self.clone()) + } + pub fn feed_recycle_bin_client(&self) -> feed_recycle_bin::Client { + feed_recycle_bin::Client(self.clone()) + } + pub fn provenance_client(&self) -> provenance::Client { + provenance::Client(self.clone()) + } + pub fn recycle_bin_client(&self) -> recycle_bin::Client { + recycle_bin::Client(self.clone()) + } + pub fn retention_policies_client(&self) -> retention_policies::Client { + retention_policies::Client(self.clone()) + } + pub fn service_settings_client(&self) -> service_settings::Client { + service_settings::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod service_settings { + use super::super::models; + use super::super::service_settings::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all service-wide feed creation and administration permissions."] + #[doc = ""] + #[doc = "See [`get_global_permissions`](super::super::service_settings::Client::get_global_permissions) for details of the arguments."] + pub fn get_global_permissions( + &self, + organization: impl Into, + ) -> get_global_permissions::RequestBuilder { + get_global_permissions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + include_ids: None, + } + } + #[doc = "Set service-wide permissions that govern feed creation and administration."] + #[doc = ""] + #[doc = "See [`set_global_permissions`](super::super::service_settings::Client::set_global_permissions) for details of the arguments."] + pub fn set_global_permissions( + &self, + organization: impl Into, + body: Vec, + ) -> set_global_permissions::RequestBuilder { + set_global_permissions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + } + } + } + } + pub mod change_tracking { + use super::super::change_tracking::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Query to determine which feeds have changed since the last call, tracked through the provided continuation token. Only changes to a feed itself are returned and impact the continuation token, not additions or alterations to packages within the feeds.\n\nIf the project parameter is present, gets all feed changes in the given project.\nIf omitted, gets all feed changes in the organization."] + #[doc = ""] + #[doc = "See [`get_feed_changes`](super::super::change_tracking::Client::get_feed_changes) for details of the arguments."] + pub fn get_feed_changes( + &self, + organization: impl Into, + project: impl Into, + ) -> get_feed_changes::RequestBuilder { + get_feed_changes::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + include_deleted: None, + continuation_token: None, + batch_size: None, + } + } + #[doc = "Query a feed to determine its current state.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_feed_change`](super::super::change_tracking::Client::get_feed_change) for details of the arguments."] + pub fn get_feed_change( + &self, + organization: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> get_feed_change::RequestBuilder { + get_feed_change::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "Get a batch of package changes made to a feed. The changes returned are 'most recent change' so if an Add is followed by an Update before you begin enumerating, you'll only see one change in the batch. While consuming batches using the continuation token, you may see changes to the same package version multiple times if they are happening as you enumerate.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_changes`](super::super::change_tracking::Client::get_package_changes) for details of the arguments."] + pub fn get_package_changes( + &self, + organization: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> get_package_changes::RequestBuilder { + get_package_changes::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + project: project.into(), + continuation_token: None, + batch_size: None, + } + } + } + } + pub mod feed_recycle_bin { + use super::super::feed_recycle_bin::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Query for feeds within the recycle bin.\n\nIf the project parameter is present, gets all feeds in recycle bin in the given project.\nIf omitted, gets all feeds in recycle bin in the organization."] + #[doc = ""] + #[doc = "See [`list`](super::super::feed_recycle_bin::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "See [`restore_deleted_feed`](super::super::feed_recycle_bin::Client::restore_deleted_feed) for details of the arguments."] + pub fn restore_deleted_feed( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> restore_deleted_feed::RequestBuilder { + restore_deleted_feed::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "See [`permanent_delete_feed`](super::super::feed_recycle_bin::Client::permanent_delete_feed) for details of the arguments."] + pub fn permanent_delete_feed( + &self, + organization: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> permanent_delete_feed::RequestBuilder { + permanent_delete_feed::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + } + } + pub mod feed_management { + use super::super::feed_management::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all feeds in an account where you have the provided role access.\n\nIf the project parameter is present, gets all feeds in the given project.\nIf omitted, gets all feeds in the organization."] + #[doc = ""] + #[doc = "See [`get_feeds`](super::super::feed_management::Client::get_feeds) for details of the arguments."] + pub fn get_feeds( + &self, + organization: impl Into, + project: impl Into, + ) -> get_feeds::RequestBuilder { + get_feeds::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + feed_role: None, + include_deleted_upstreams: None, + include_urls: None, + } + } + #[doc = "Create a feed, a container for various package types.\n\nFeeds can be created in a project if the project parameter is included in the request url.\nIf the project parameter is omitted, the feed will not be associated with a project and will be created at the organization level."] + #[doc = ""] + #[doc = "See [`create_feed`](super::super::feed_management::Client::create_feed) for details of the arguments."] + pub fn create_feed( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create_feed::RequestBuilder { + create_feed::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get the settings for a specific feed.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_feed`](super::super::feed_management::Client::get_feed) for details of the arguments."] + pub fn get_feed( + &self, + organization: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> get_feed::RequestBuilder { + get_feed::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + project: project.into(), + include_deleted_upstreams: None, + } + } + #[doc = "Change the attributes of a feed.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_feed`](super::super::feed_management::Client::update_feed) for details of the arguments."] + pub fn update_feed( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> update_feed::RequestBuilder { + update_feed::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "Remove a feed and all its packages. The feed moves to the recycle bin and is reversible.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`delete_feed`](super::super::feed_management::Client::delete_feed) for details of the arguments."] + pub fn delete_feed( + &self, + organization: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> delete_feed::RequestBuilder { + delete_feed::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "Get the permissions for a feed.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_feed_permissions`](super::super::feed_management::Client::get_feed_permissions) for details of the arguments."] + pub fn get_feed_permissions( + &self, + organization: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> get_feed_permissions::RequestBuilder { + get_feed_permissions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + project: project.into(), + include_ids: None, + exclude_inherited_permissions: None, + identity_descriptor: None, + include_deleted_feeds: None, + } + } + #[doc = "Update the permissions on a feed.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`set_feed_permissions`](super::super::feed_management::Client::set_feed_permissions) for details of the arguments."] + pub fn set_feed_permissions( + &self, + organization: impl Into, + body: Vec, + feed_id: impl Into, + project: impl Into, + ) -> set_feed_permissions::RequestBuilder { + set_feed_permissions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "Get all views for a feed.\n\nThe project parameter must be supplied if the feed was created in a project."] + #[doc = ""] + #[doc = "See [`get_feed_views`](super::super::feed_management::Client::get_feed_views) for details of the arguments."] + pub fn get_feed_views( + &self, + organization: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> get_feed_views::RequestBuilder { + get_feed_views::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "Create a new view on the referenced feed.\n\nThe project parameter must be supplied if the feed was created in a project."] + #[doc = ""] + #[doc = "See [`create_feed_view`](super::super::feed_management::Client::create_feed_view) for details of the arguments."] + pub fn create_feed_view( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> create_feed_view::RequestBuilder { + create_feed_view::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "Get a view by Id.\n\nThe project parameter must be supplied if the feed was created in a project."] + #[doc = ""] + #[doc = "See [`get_feed_view`](super::super::feed_management::Client::get_feed_view) for details of the arguments."] + pub fn get_feed_view( + &self, + organization: impl Into, + feed_id: impl Into, + view_id: impl Into, + project: impl Into, + ) -> get_feed_view::RequestBuilder { + get_feed_view::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + view_id: view_id.into(), + project: project.into(), + } + } + #[doc = "Update a view.\n\nThe project parameter must be supplied if the feed was created in a project."] + #[doc = ""] + #[doc = "See [`update_feed_view`](super::super::feed_management::Client::update_feed_view) for details of the arguments."] + pub fn update_feed_view( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + view_id: impl Into, + project: impl Into, + ) -> update_feed_view::RequestBuilder { + update_feed_view::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + view_id: view_id.into(), + project: project.into(), + } + } + #[doc = "Delete a feed view.\n\nThe project parameter must be supplied if the feed was created in a project."] + #[doc = ""] + #[doc = "See [`delete_feed_view`](super::super::feed_management::Client::delete_feed_view) for details of the arguments."] + pub fn delete_feed_view( + &self, + organization: impl Into, + feed_id: impl Into, + view_id: impl Into, + project: impl Into, + ) -> delete_feed_view::RequestBuilder { + delete_feed_view::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + view_id: view_id.into(), + project: project.into(), + } + } + } + } + pub mod artifact_details { + use super::super::artifact_details::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`query_package_metrics`](super::super::artifact_details::Client::query_package_metrics) for details of the arguments."] + pub fn query_package_metrics( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> query_package_metrics::RequestBuilder { + query_package_metrics::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "Get details about all of the packages in the feed. Use the various filters to include or exclude information from the result set.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_packages`](super::super::artifact_details::Client::get_packages) for details of the arguments."] + pub fn get_packages( + &self, + organization: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> get_packages::RequestBuilder { + get_packages::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + project: project.into(), + protocol_type: None, + package_name_query: None, + normalized_package_name: None, + include_urls: None, + include_all_versions: None, + is_listed: None, + get_top_package_versions: None, + is_release: None, + include_description: None, + top: None, + skip: None, + include_deleted: None, + is_cached: None, + direct_upstream_id: None, + } + } + #[doc = "Get details about a specific package.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package`](super::super::artifact_details::Client::get_package) for details of the arguments."] + pub fn get_package( + &self, + organization: impl Into, + feed_id: impl Into, + package_id: impl Into, + project: impl Into, + ) -> get_package::RequestBuilder { + get_package::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_id: package_id.into(), + project: project.into(), + include_all_versions: None, + include_urls: None, + is_listed: None, + is_release: None, + include_deleted: None, + include_description: None, + } + } + #[doc = "See [`query_package_version_metrics`](super::super::artifact_details::Client::query_package_version_metrics) for details of the arguments."] + pub fn query_package_version_metrics( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + package_id: impl Into, + project: impl Into, + ) -> query_package_version_metrics::RequestBuilder { + query_package_version_metrics::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + package_id: package_id.into(), + project: project.into(), + } + } + #[doc = "Get a list of package versions, optionally filtering by state.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_versions`](super::super::artifact_details::Client::get_package_versions) for details of the arguments."] + pub fn get_package_versions( + &self, + organization: impl Into, + feed_id: impl Into, + package_id: impl Into, + project: impl Into, + ) -> get_package_versions::RequestBuilder { + get_package_versions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_id: package_id.into(), + project: project.into(), + include_urls: None, + is_listed: None, + is_deleted: None, + } + } + #[doc = "Get details about a specific package version.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_version`](super::super::artifact_details::Client::get_package_version) for details of the arguments."] + pub fn get_package_version( + &self, + organization: impl Into, + feed_id: impl Into, + package_id: impl Into, + package_version_id: impl Into, + project: impl Into, + ) -> get_package_version::RequestBuilder { + get_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_id: package_id.into(), + package_version_id: package_version_id.into(), + project: project.into(), + include_urls: None, + is_listed: None, + is_deleted: None, + } + } + #[doc = "Gets provenance for a package version.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_version_provenance`](super::super::artifact_details::Client::get_package_version_provenance) for details of the arguments."] + pub fn get_package_version_provenance( + &self, + organization: impl Into, + feed_id: impl Into, + package_id: impl Into, + package_version_id: impl Into, + project: impl Into, + ) -> get_package_version_provenance::RequestBuilder { + get_package_version_provenance::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_id: package_id.into(), + package_version_id: package_version_id.into(), + project: project.into(), + } + } + #[doc = "Generate a SVG badge for the latest version of a package. The generated SVG is typically used as the image in an HTML link which takes users to the feed containing the package to accelerate discovery and consumption.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_badge`](super::super::artifact_details::Client::get_badge) for details of the arguments."] + pub fn get_badge( + &self, + organization: impl Into, + feed_id: impl Into, + package_id: impl Into, + project: impl Into, + ) -> get_badge::RequestBuilder { + get_badge::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_id: package_id.into(), + project: project.into(), + } + } + } + } + pub mod recycle_bin { + use super::super::models; + use super::super::recycle_bin::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Query for packages within the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_recycle_bin_packages`](super::super::recycle_bin::Client::get_recycle_bin_packages) for details of the arguments."] + pub fn get_recycle_bin_packages( + &self, + organization: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> get_recycle_bin_packages::RequestBuilder { + get_recycle_bin_packages::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + project: project.into(), + protocol_type: None, + package_name_query: None, + include_urls: None, + top: None, + skip: None, + include_all_versions: None, + } + } + #[doc = "Queues a job to remove all package versions from a feed's recycle bin"] + #[doc = ""] + #[doc = "See [`empty_recycle_bin`](super::super::recycle_bin::Client::empty_recycle_bin) for details of the arguments."] + pub fn empty_recycle_bin( + &self, + organization: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> empty_recycle_bin::RequestBuilder { + empty_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "Get information about a package and all its versions within the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_recycle_bin_package`](super::super::recycle_bin::Client::get_recycle_bin_package) for details of the arguments."] + pub fn get_recycle_bin_package( + &self, + organization: impl Into, + feed_id: impl Into, + package_id: impl Into, + project: impl Into, + ) -> get_recycle_bin_package::RequestBuilder { + get_recycle_bin_package::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_id: package_id.into(), + project: project.into(), + include_urls: None, + } + } + #[doc = "Get a list of package versions within the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_recycle_bin_package_versions`](super::super::recycle_bin::Client::get_recycle_bin_package_versions) for details of the arguments."] + pub fn get_recycle_bin_package_versions( + &self, + organization: impl Into, + feed_id: impl Into, + package_id: impl Into, + project: impl Into, + ) -> get_recycle_bin_package_versions::RequestBuilder { + get_recycle_bin_package_versions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_id: package_id.into(), + project: project.into(), + include_urls: None, + } + } + #[doc = "Get information about a package version within the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_recycle_bin_package_version`](super::super::recycle_bin::Client::get_recycle_bin_package_version) for details of the arguments."] + pub fn get_recycle_bin_package_version( + &self, + organization: impl Into, + feed_id: impl Into, + package_id: impl Into, + package_version_id: impl Into, + project: impl Into, + ) -> get_recycle_bin_package_version::RequestBuilder { + get_recycle_bin_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_id: package_id.into(), + package_version_id: package_version_id.into(), + project: project.into(), + include_urls: None, + } + } + } + } + pub mod retention_policies { + use super::super::models; + use super::super::retention_policies::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the retention policy for a feed.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_retention_policy`](super::super::retention_policies::Client::get_retention_policy) for details of the arguments."] + pub fn get_retention_policy( + &self, + organization: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> get_retention_policy::RequestBuilder { + get_retention_policy::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "Set the retention policy for a feed.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`set_retention_policy`](super::super::retention_policies::Client::set_retention_policy) for details of the arguments."] + pub fn set_retention_policy( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> set_retention_policy::RequestBuilder { + set_retention_policy::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "Delete the retention policy for a feed.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`delete_retention_policy`](super::super::retention_policies::Client::delete_retention_policy) for details of the arguments."] + pub fn delete_retention_policy( + &self, + organization: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> delete_retention_policy::RequestBuilder { + delete_retention_policy::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + } + } + pub mod provenance { + use super::super::models; + use super::super::provenance::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Creates a session, a wrapper around a feed that can store additional metadata on the packages published to it."] + #[doc = ""] + #[doc = "See [`create_session`](super::super::provenance::Client::create_session) for details of the arguments."] + pub fn create_session( + &self, + organization: impl Into, + body: impl Into, + protocol: impl Into, + project: impl Into, + ) -> create_session::RequestBuilder { + create_session::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + protocol: protocol.into(), + project: project.into(), + } + } + } + } +} 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 abc8114a..8099138f 100644 --- a/azure_devops_rust_api/src/artifacts_package_types/mod.rs +++ b/azure_devops_rust_api/src/artifacts_package_types/mod.rs @@ -489,14 +489,49 @@ pub mod maven { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed: String, pub(crate) group_id: String, pub(crate) artifact_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed, + self.group_id, + self.artifact_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -506,9 +541,7 @@ pub mod maven { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -520,28 +553,24 @@ pub mod maven { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed, - self.group_id, - self.artifact_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -586,8 +615,12 @@ pub mod maven { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed: String, pub(crate) group_id: String, @@ -595,6 +628,38 @@ pub mod maven { pub(crate) body: models::UpstreamingBehavior, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed, + self.group_id, + self.artifact_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -604,9 +669,7 @@ pub mod maven { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -618,29 +681,24 @@ pub mod maven { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed, - self.group_id, - self.artifact_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -693,8 +751,12 @@ pub mod maven { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed: String, pub(crate) group_id: String, @@ -703,12 +765,50 @@ pub mod maven { pub(crate) project: String, pub(crate) show_deleted: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to show information for deleted packages."] pub fn show_deleted(mut self, show_deleted: bool) -> Self { self.show_deleted = Some(show_deleted); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed, + self.group_id, + self.artifact_id, + self.version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -717,9 +817,7 @@ pub mod maven { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -731,34 +829,24 @@ pub mod maven { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed, - self.group_id, - self.artifact_id, - self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -803,8 +891,12 @@ pub mod maven { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PackageVersionDetails, pub(crate) feed: String, @@ -813,6 +905,39 @@ pub mod maven { pub(crate) version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed, + self.group_id, + self.artifact_id, + self.version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -822,9 +947,7 @@ pub mod maven { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -836,30 +959,24 @@ pub mod maven { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed, - self.group_id, - self.artifact_id, - self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -907,8 +1024,12 @@ pub mod maven { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed: String, pub(crate) group_id: String, @@ -916,6 +1037,38 @@ pub mod maven { pub(crate) version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed, + self.group_id, + self.artifact_id, + self.version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -925,9 +1078,7 @@ pub mod maven { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -939,29 +1090,24 @@ pub mod maven { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed, - self.group_id, - self.artifact_id, - self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1017,8 +1163,12 @@ pub mod maven { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed: String, pub(crate) group_id: String, @@ -1026,6 +1176,29 @@ pub mod maven { pub(crate) version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1035,9 +1208,7 @@ pub mod maven { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1049,20 +1220,24 @@ pub mod maven { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1108,8 +1283,12 @@ pub mod maven { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::MavenRecycleBinPackageVersionDetails, pub(crate) feed: String, @@ -1118,6 +1297,30 @@ pub mod maven { pub(crate) version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1127,9 +1330,7 @@ pub mod maven { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1141,21 +1342,24 @@ pub mod maven { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1203,8 +1407,12 @@ pub mod maven { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed: String, pub(crate) group_id: String, @@ -1212,6 +1420,29 @@ pub mod maven { pub(crate) version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1221,9 +1452,7 @@ pub mod maven { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1235,20 +1464,24 @@ pub mod maven { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1296,13 +1529,47 @@ pub mod maven { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::MavenPackagesBatchRequest, pub(crate) feed: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/packagesBatch", + self.client.endpoint(), + self.organization, + self.project, + self.feed + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1312,9 +1579,7 @@ pub mod maven { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1326,27 +1591,24 @@ pub mod maven { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/maven/RecycleBin/packagesBatch", - self.client.endpoint(), - self.organization, - self.project, - self.feed - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1397,8 +1659,12 @@ pub mod maven { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) group_id: String, @@ -1407,6 +1673,39 @@ pub mod maven { pub(crate) file_name: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/maven/{}/{}/{}/{}/content", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.group_id, + self.artifact_id, + self.version, + self.file_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1416,9 +1715,7 @@ pub mod maven { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1430,30 +1727,24 @@ pub mod maven { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/maven/{}/{}/{}/{}/content", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.group_id, - self.artifact_id, - self.version, - self.file_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1498,13 +1789,47 @@ pub mod maven { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::MavenPackagesBatchRequest, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/maven/packagesbatch", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1514,9 +1839,7 @@ pub mod maven { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1528,27 +1851,24 @@ pub mod maven { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/maven/packagesbatch", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2170,8 +2490,12 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_scope: String, @@ -2179,6 +2503,38 @@ pub mod npm { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_scope, + self.unscoped_package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2188,9 +2544,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2202,29 +2556,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_scope, - self.unscoped_package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2274,8 +2623,12 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PackageVersionDetails, pub(crate) feed_id: String, @@ -2284,6 +2637,39 @@ pub mod npm { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_scope, + self.unscoped_package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2293,9 +2679,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2307,30 +2691,24 @@ pub mod npm { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_scope, - self.unscoped_package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2380,8 +2758,12 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_scope: String, @@ -2389,6 +2771,38 @@ pub mod npm { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_scope, + self.unscoped_package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2398,9 +2812,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2412,29 +2824,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/@{}/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_scope, - self.unscoped_package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2484,14 +2891,49 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2501,9 +2943,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2515,28 +2955,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2586,8 +3022,12 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PackageVersionDetails, pub(crate) feed_id: String, @@ -2595,6 +3035,38 @@ pub mod npm { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2604,9 +3076,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2618,29 +3088,24 @@ pub mod npm { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2690,14 +3155,49 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2707,9 +3207,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2721,28 +3219,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2792,14 +3286,49 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_scope: String, pub(crate) unscoped_package_name: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/upstreaming", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_scope, + self.unscoped_package_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2809,9 +3338,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2823,28 +3350,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/upstreaming", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_scope, - self.unscoped_package_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2889,8 +3412,12 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_scope: String, @@ -2898,6 +3425,38 @@ pub mod npm { pub(crate) body: models::UpstreamingBehavior, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/upstreaming", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_scope, + self.unscoped_package_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2907,9 +3466,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2921,29 +3478,24 @@ pub mod npm { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/@{}/{}/upstreaming", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_scope, - self.unscoped_package_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2994,8 +3546,12 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_scope: String, @@ -3003,6 +3559,38 @@ pub mod npm { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_scope, + self.unscoped_package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3012,9 +3600,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3026,29 +3612,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_scope, - self.unscoped_package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3096,8 +3677,12 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_scope: String, @@ -3105,6 +3690,38 @@ pub mod npm { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_scope, + self.unscoped_package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3114,9 +3731,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3128,29 +3743,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_scope, - self.unscoped_package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3200,13 +3810,47 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/upstreaming", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3216,9 +3860,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3230,27 +3872,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/upstreaming", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3295,14 +3934,49 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) body: models::UpstreamingBehavior, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/upstreaming", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3312,9 +3986,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3326,28 +3998,24 @@ pub mod npm { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/packages/{}/upstreaming", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3398,14 +4066,49 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3415,9 +4118,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3429,28 +4130,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3498,14 +4195,49 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3515,9 +4247,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3529,28 +4259,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3595,13 +4321,47 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::NpmPackagesBatchRequest, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/packagesbatch", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3611,9 +4371,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3625,27 +4383,24 @@ pub mod npm { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/packagesbatch", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3701,8 +4456,12 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_scope: String, @@ -3710,6 +4469,38 @@ pub mod npm { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_scope, + self.unscoped_package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3719,9 +4510,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3733,29 +4522,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_scope, - self.unscoped_package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3801,8 +4585,12 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::NpmRecycleBinPackageVersionDetails, pub(crate) feed_id: String, @@ -3811,6 +4599,39 @@ pub mod npm { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_scope, + self.unscoped_package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3820,9 +4641,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3834,30 +4653,24 @@ pub mod npm { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_scope, - self.unscoped_package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3905,8 +4718,12 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_scope: String, @@ -3914,6 +4731,38 @@ pub mod npm { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_scope, + self.unscoped_package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3923,9 +4772,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3937,29 +4784,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_scope, - self.unscoped_package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4015,14 +4857,49 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4032,9 +4909,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4046,28 +4921,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4113,8 +4984,12 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::NpmRecycleBinPackageVersionDetails, pub(crate) feed_id: String, @@ -4122,6 +4997,38 @@ pub mod npm { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4131,9 +5038,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4145,29 +5050,24 @@ pub mod npm { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4215,14 +5115,49 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4232,9 +5167,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4246,28 +5179,24 @@ pub mod npm { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4315,13 +5244,47 @@ pub mod npm { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::NpmPackagesBatchRequest, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/PackagesBatch", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4331,9 +5294,7 @@ pub mod npm { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4345,27 +5306,24 @@ pub mod npm { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/npm/RecycleBin/PackagesBatch", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4702,13 +5660,47 @@ pub mod nu_get { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/upstreaming", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4718,9 +5710,7 @@ pub mod nu_get { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4732,27 +5722,24 @@ pub mod nu_get { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/upstreaming", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4797,14 +5784,49 @@ pub mod nu_get { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) body: models::UpstreamingBehavior, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/upstreaming", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4814,9 +5836,7 @@ pub mod nu_get { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4828,28 +5848,24 @@ pub mod nu_get { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/upstreaming", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4902,8 +5918,12 @@ pub mod nu_get { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, @@ -4911,12 +5931,49 @@ pub mod nu_get { pub(crate) project: String, pub(crate) show_deleted: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to include deleted packages in the response."] pub fn show_deleted(mut self, show_deleted: bool) -> Self { self.show_deleted = Some(show_deleted); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4925,9 +5982,7 @@ pub mod nu_get { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4939,33 +5994,24 @@ pub mod nu_get { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5010,8 +6056,12 @@ pub mod nu_get { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PackageVersionDetails, pub(crate) feed_id: String, @@ -5019,6 +6069,38 @@ pub mod nu_get { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5028,9 +6110,7 @@ pub mod nu_get { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5042,29 +6122,24 @@ pub mod nu_get { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5117,14 +6192,49 @@ pub mod nu_get { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5134,9 +6244,7 @@ pub mod nu_get { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5148,28 +6256,24 @@ pub mod nu_get { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packages/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5217,8 +6321,12 @@ pub mod nu_get { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, @@ -5226,7 +6334,7 @@ pub mod nu_get { pub(crate) project: String, pub(crate) source_protocol_version: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Unused"] pub fn source_protocol_version( mut self, @@ -5235,6 +6343,43 @@ pub mod nu_get { self.source_protocol_version = Some(source_protocol_version.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5243,9 +6388,7 @@ pub mod nu_get { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5257,33 +6400,24 @@ pub mod nu_get { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5328,13 +6462,47 @@ pub mod nu_get { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::NuGetPackagesBatchRequest, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packagesbatch", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5344,9 +6512,7 @@ pub mod nu_get { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5358,27 +6524,24 @@ pub mod nu_get { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/packagesbatch", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5434,14 +6597,49 @@ pub mod nu_get { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5451,9 +6649,7 @@ pub mod nu_get { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5465,28 +6661,24 @@ pub mod nu_get { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5532,8 +6724,12 @@ pub mod nu_get { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::NuGetRecycleBinPackageVersionDetails, pub(crate) feed_id: String, @@ -5541,6 +6737,38 @@ pub mod nu_get { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5550,9 +6778,7 @@ pub mod nu_get { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5564,29 +6790,24 @@ pub mod nu_get { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5634,42 +6855,30 @@ pub mod nu_get { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -5689,6 +6898,47 @@ pub mod nu_get { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result<()>; type IntoFuture = BoxFuture<'static, azure_core::Result<()>>; @@ -5734,13 +6984,47 @@ pub mod nu_get { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::NuGetPackagesBatchRequest, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packagesBatch", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5750,9 +7034,7 @@ pub mod nu_get { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5764,27 +7046,24 @@ pub mod nu_get { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/nuget/RecycleBin/packagesBatch", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6123,13 +7402,47 @@ pub mod python { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/upstreaming", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6139,9 +7452,7 @@ pub mod python { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6153,27 +7464,24 @@ pub mod python { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/upstreaming", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6218,14 +7526,49 @@ pub mod python { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) body: models::UpstreamingBehavior, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/upstreaming", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6235,9 +7578,7 @@ pub mod python { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6249,28 +7590,24 @@ pub mod python { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/upstreaming", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6323,8 +7660,12 @@ pub mod python { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, @@ -6332,12 +7673,49 @@ pub mod python { pub(crate) project: String, pub(crate) show_deleted: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to show information for deleted package versions."] pub fn show_deleted(mut self, show_deleted: bool) -> Self { self.show_deleted = Some(show_deleted); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6346,9 +7724,7 @@ pub mod python { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6360,33 +7736,24 @@ pub mod python { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6431,8 +7798,12 @@ pub mod python { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PackageVersionDetails, pub(crate) feed_id: String, @@ -6440,6 +7811,38 @@ pub mod python { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6449,9 +7852,7 @@ pub mod python { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6463,29 +7864,24 @@ pub mod python { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6538,14 +7934,49 @@ pub mod python { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6555,9 +7986,7 @@ pub mod python { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6569,28 +7998,24 @@ pub mod python { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packages/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6638,8 +8063,12 @@ pub mod python { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, @@ -6647,8 +8076,40 @@ pub mod python { pub(crate) file_name: String, pub(crate) project: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version, + self.file_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] #[doc = "However, this function can provide more flexibility when required."] @@ -6656,9 +8117,7 @@ pub mod python { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6670,29 +8129,24 @@ pub mod python { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version, - self.file_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6737,13 +8191,47 @@ pub mod python { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PyPiPackagesBatchRequest, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packagesbatch", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6753,9 +8241,7 @@ pub mod python { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6767,27 +8253,24 @@ pub mod python { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/packagesbatch", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6843,14 +8326,49 @@ pub mod python { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6860,9 +8378,7 @@ pub mod python { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6874,28 +8390,24 @@ pub mod python { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6941,8 +8453,12 @@ pub mod python { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PyPiRecycleBinPackageVersionDetails, pub(crate) feed_id: String, @@ -6950,6 +8466,38 @@ pub mod python { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6959,9 +8507,7 @@ pub mod python { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6973,29 +8519,24 @@ pub mod python { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7043,14 +8584,49 @@ pub mod python { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7060,9 +8636,7 @@ pub mod python { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7074,28 +8648,24 @@ pub mod python { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7143,13 +8713,47 @@ pub mod python { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PyPiPackagesBatchRequest, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packagesBatch", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7159,9 +8763,7 @@ pub mod python { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7173,27 +8775,24 @@ pub mod python { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/pypi/RecycleBin/packagesBatch", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7456,8 +9055,12 @@ pub mod universal { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, @@ -7465,12 +9068,49 @@ pub mod universal { pub(crate) project: String, pub(crate) show_deleted: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to show information for deleted versions"] pub fn show_deleted(mut self, show_deleted: bool) -> Self { self.show_deleted = Some(show_deleted); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7479,9 +9119,7 @@ pub mod universal { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7493,33 +9131,24 @@ pub mod universal { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7564,8 +9193,12 @@ pub mod universal { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PackageVersionDetails, pub(crate) feed_id: String, @@ -7573,6 +9206,38 @@ pub mod universal { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7582,9 +9247,7 @@ pub mod universal { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7596,29 +9259,24 @@ pub mod universal { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7671,14 +9329,49 @@ pub mod universal { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7688,9 +9381,7 @@ pub mod universal { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7702,28 +9393,24 @@ pub mod universal { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/upack/packages/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7768,13 +9455,47 @@ pub mod universal { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UPackPackagesBatchRequest, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/upack/packagesbatch", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7784,9 +9505,7 @@ pub mod universal { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7798,27 +9517,24 @@ pub mod universal { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/upack/packagesbatch", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7874,14 +9590,49 @@ pub mod universal { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7891,9 +9642,7 @@ pub mod universal { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7905,28 +9654,24 @@ pub mod universal { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7972,8 +9717,12 @@ pub mod universal { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UPackRecycleBinPackageVersionDetails, pub(crate) feed_id: String, @@ -7981,6 +9730,38 @@ pub mod universal { pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7990,9 +9771,7 @@ pub mod universal { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8004,29 +9783,24 @@ pub mod universal { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8074,14 +9848,49 @@ pub mod universal { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) feed_id: String, pub(crate) package_name: String, pub(crate) package_version: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.feed_id, + self.package_name, + self.package_version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8091,9 +9900,7 @@ pub mod universal { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8105,28 +9912,24 @@ pub mod universal { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.feed_id, - self.package_name, - self.package_version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8174,13 +9977,47 @@ pub mod universal { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UPackPackagesBatchRequest, pub(crate) feed_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packagesBatch", + self.client.endpoint(), + self.organization, + self.project, + self.feed_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8190,9 +10027,7 @@ pub mod universal { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8204,27 +10039,24 @@ pub mod universal { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/packaging/feeds/{}/upack/RecycleBin/packagesBatch", - self.client.endpoint(), - self.organization, - self.project, - self.feed_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8244,3 +10076,1441 @@ pub mod universal { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn maven_client(&self) -> maven::Client { + maven::Client(self.clone()) + } + pub fn npm_client(&self) -> npm::Client { + npm::Client(self.clone()) + } + pub fn nu_get_client(&self) -> nu_get::Client { + nu_get::Client(self.clone()) + } + pub fn python_client(&self) -> python::Client { + python::Client(self.clone()) + } + pub fn universal_client(&self) -> universal::Client { + universal::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod maven { + use super::super::maven::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the upstreaming behavior of a package within the context of a feed"] + #[doc = ""] + #[doc = "See [`get_upstreaming_behavior`](super::super::maven::Client::get_upstreaming_behavior) for details of the arguments."] + pub fn get_upstreaming_behavior( + &self, + organization: impl Into, + feed: impl Into, + group_id: impl Into, + artifact_id: impl Into, + project: impl Into, + ) -> get_upstreaming_behavior::RequestBuilder { + get_upstreaming_behavior::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed: feed.into(), + group_id: group_id.into(), + artifact_id: artifact_id.into(), + project: project.into(), + } + } + #[doc = "Set the upstreaming behavior of a package within the context of a feed\n\nThe package does not need to necessarily exist in the feed prior to setting the behavior.\nThis assists with packages that are not yet ingested from an upstream, yet the feed owner wants\nto apply a specific behavior on the first ingestion."] + #[doc = ""] + #[doc = "See [`set_upstreaming_behavior`](super::super::maven::Client::set_upstreaming_behavior) for details of the arguments."] + pub fn set_upstreaming_behavior( + &self, + organization: impl Into, + feed: impl Into, + group_id: impl Into, + artifact_id: impl Into, + body: impl Into, + project: impl Into, + ) -> set_upstreaming_behavior::RequestBuilder { + set_upstreaming_behavior::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed: feed.into(), + group_id: group_id.into(), + artifact_id: artifact_id.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get information about a package version.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_version`](super::super::maven::Client::get_package_version) for details of the arguments."] + pub fn get_package_version( + &self, + organization: impl Into, + feed: impl Into, + group_id: impl Into, + artifact_id: impl Into, + version: impl Into, + project: impl Into, + ) -> get_package_version::RequestBuilder { + get_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed: feed.into(), + group_id: group_id.into(), + artifact_id: artifact_id.into(), + version: version.into(), + project: project.into(), + show_deleted: None, + } + } + #[doc = "Update state for a package version.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_package_version`](super::super::maven::Client::update_package_version) for details of the arguments."] + pub fn update_package_version( + &self, + organization: impl Into, + body: impl Into, + feed: impl Into, + group_id: impl Into, + artifact_id: impl Into, + version: impl Into, + project: impl Into, + ) -> update_package_version::RequestBuilder { + update_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed: feed.into(), + group_id: group_id.into(), + artifact_id: artifact_id.into(), + version: version.into(), + project: project.into(), + } + } + #[doc = "Delete a package version from the feed and move it to the feed's recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`delete_package_version`](super::super::maven::Client::delete_package_version) for details of the arguments."] + pub fn delete_package_version( + &self, + organization: impl Into, + feed: impl Into, + group_id: impl Into, + artifact_id: impl Into, + version: impl Into, + project: impl Into, + ) -> delete_package_version::RequestBuilder { + delete_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed: feed.into(), + group_id: group_id.into(), + artifact_id: artifact_id.into(), + version: version.into(), + project: project.into(), + } + } + #[doc = "Get information about a package version in the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_version_from_recycle_bin`](super::super::maven::Client::get_package_version_from_recycle_bin) for details of the arguments."] + pub fn get_package_version_from_recycle_bin( + &self, + organization: impl Into, + feed: impl Into, + group_id: impl Into, + artifact_id: impl Into, + version: impl Into, + project: impl Into, + ) -> get_package_version_from_recycle_bin::RequestBuilder { + get_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed: feed.into(), + group_id: group_id.into(), + artifact_id: artifact_id.into(), + version: version.into(), + project: project.into(), + } + } + #[doc = "Restore a package version from the recycle bin to its associated feed.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`restore_package_version_from_recycle_bin`](super::super::maven::Client::restore_package_version_from_recycle_bin) for details of the arguments."] + pub fn restore_package_version_from_recycle_bin( + &self, + organization: impl Into, + body: impl Into, + feed: impl Into, + group_id: impl Into, + artifact_id: impl Into, + version: impl Into, + project: impl Into, + ) -> restore_package_version_from_recycle_bin::RequestBuilder + { + restore_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed: feed.into(), + group_id: group_id.into(), + artifact_id: artifact_id.into(), + version: version.into(), + project: project.into(), + } + } + #[doc = "Permanently delete a package from a feed's recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`delete_package_version_from_recycle_bin`](super::super::maven::Client::delete_package_version_from_recycle_bin) for details of the arguments."] + pub fn delete_package_version_from_recycle_bin( + &self, + organization: impl Into, + feed: impl Into, + group_id: impl Into, + artifact_id: impl Into, + version: impl Into, + project: impl Into, + ) -> delete_package_version_from_recycle_bin::RequestBuilder + { + delete_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed: feed.into(), + group_id: group_id.into(), + artifact_id: artifact_id.into(), + version: version.into(), + project: project.into(), + } + } + #[doc = "Delete or restore several package versions from the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_recycle_bin_packages`](super::super::maven::Client::update_recycle_bin_packages) for details of the arguments."] + pub fn update_recycle_bin_packages( + &self, + organization: impl Into, + body: impl Into, + feed: impl Into, + project: impl Into, + ) -> update_recycle_bin_packages::RequestBuilder { + update_recycle_bin_packages::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed: feed.into(), + project: project.into(), + } + } + #[doc = "Fulfills Maven package file download requests by either returning the URL of the requested package file or, in the case of Azure DevOps Server (OnPrem), returning the content as a stream.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`download_package`](super::super::maven::Client::download_package) for details of the arguments."] + pub fn download_package( + &self, + organization: impl Into, + feed_id: impl Into, + group_id: impl Into, + artifact_id: impl Into, + version: impl Into, + file_name: impl Into, + project: impl Into, + ) -> download_package::RequestBuilder { + download_package::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + group_id: group_id.into(), + artifact_id: artifact_id.into(), + version: version.into(), + file_name: file_name.into(), + project: project.into(), + } + } + #[doc = "Update several packages from a single feed in a single request. The updates to the packages do not happen atomically.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_package_versions`](super::super::maven::Client::update_package_versions) for details of the arguments."] + pub fn update_package_versions( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> update_package_versions::RequestBuilder { + update_package_versions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + } + } + pub mod npm { + use super::super::models; + use super::super::npm::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get information about a scoped package version (such as @scope/name).\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_scoped_package_version`](super::super::npm::Client::get_scoped_package_version) for details of the arguments."] + pub fn get_scoped_package_version( + &self, + organization: impl Into, + feed_id: impl Into, + package_scope: impl Into, + unscoped_package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> get_scoped_package_version::RequestBuilder { + get_scoped_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_scope: package_scope.into(), + unscoped_package_name: unscoped_package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "See [`update_scoped_package`](super::super::npm::Client::update_scoped_package) for details of the arguments."] + pub fn update_scoped_package( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + package_scope: impl Into, + unscoped_package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> update_scoped_package::RequestBuilder { + update_scoped_package::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + package_scope: package_scope.into(), + unscoped_package_name: unscoped_package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Unpublish a scoped package version (such as @scope/name).\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`unpublish_scoped_package`](super::super::npm::Client::unpublish_scoped_package) for details of the arguments."] + pub fn unpublish_scoped_package( + &self, + organization: impl Into, + feed_id: impl Into, + package_scope: impl Into, + unscoped_package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> unpublish_scoped_package::RequestBuilder { + unpublish_scoped_package::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_scope: package_scope.into(), + unscoped_package_name: unscoped_package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Get information about an unscoped package version.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_version`](super::super::npm::Client::get_package_version) for details of the arguments."] + pub fn get_package_version( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> get_package_version::RequestBuilder { + get_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "See [`update_package`](super::super::npm::Client::update_package) for details of the arguments."] + pub fn update_package( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> update_package::RequestBuilder { + update_package::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Unpublish an unscoped package version.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`unpublish_package`](super::super::npm::Client::unpublish_package) for details of the arguments."] + pub fn unpublish_package( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> unpublish_package::RequestBuilder { + unpublish_package::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Get the upstreaming behavior of the (scoped) package within the context of a feed"] + #[doc = ""] + #[doc = "See [`get_package_upstreaming_behavior`](super::super::npm::Client::get_package_upstreaming_behavior) for details of the arguments."] + pub fn get_package_upstreaming_behavior( + &self, + organization: impl Into, + feed_id: impl Into, + package_scope: impl Into, + unscoped_package_name: impl Into, + project: impl Into, + ) -> get_package_upstreaming_behavior::RequestBuilder { + get_package_upstreaming_behavior::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_scope: package_scope.into(), + unscoped_package_name: unscoped_package_name.into(), + project: project.into(), + } + } + #[doc = "Set the upstreaming behavior of a (scoped) package within the context of a feed\n\nThe package does not need to necessarily exist in the feed prior to setting the behavior.\nThis assists with packages that are not yet ingested from an upstream, yet the feed owner wants\nto apply a specific behavior on the first ingestion."] + #[doc = ""] + #[doc = "See [`set_scoped_upstreaming_behavior`](super::super::npm::Client::set_scoped_upstreaming_behavior) for details of the arguments."] + pub fn set_scoped_upstreaming_behavior( + &self, + organization: impl Into, + feed_id: impl Into, + package_scope: impl Into, + unscoped_package_name: impl Into, + body: impl Into, + project: impl Into, + ) -> set_scoped_upstreaming_behavior::RequestBuilder { + set_scoped_upstreaming_behavior::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_scope: package_scope.into(), + unscoped_package_name: unscoped_package_name.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "See [`download_scoped_package`](super::super::npm::Client::download_scoped_package) for details of the arguments."] + pub fn download_scoped_package( + &self, + organization: impl Into, + feed_id: impl Into, + package_scope: impl Into, + unscoped_package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> download_scoped_package::RequestBuilder { + download_scoped_package::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_scope: package_scope.into(), + unscoped_package_name: unscoped_package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Get the Readme for a package version with an npm scope.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_scoped_package_readme`](super::super::npm::Client::get_scoped_package_readme) for details of the arguments."] + pub fn get_scoped_package_readme( + &self, + organization: impl Into, + feed_id: impl Into, + package_scope: impl Into, + unscoped_package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> get_scoped_package_readme::RequestBuilder { + get_scoped_package_readme::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_scope: package_scope.into(), + unscoped_package_name: unscoped_package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Get the upstreaming behavior of the (unscoped) package within the context of a feed"] + #[doc = ""] + #[doc = "See [`get_scoped_package_upstreaming_behavior`](super::super::npm::Client::get_scoped_package_upstreaming_behavior) for details of the arguments."] + pub fn get_scoped_package_upstreaming_behavior( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + project: impl Into, + ) -> get_scoped_package_upstreaming_behavior::RequestBuilder + { + get_scoped_package_upstreaming_behavior::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + project: project.into(), + } + } + #[doc = "Set the upstreaming behavior of a (scoped) package within the context of a feed\n\nThe package does not need to necessarily exist in the feed prior to setting the behavior.\nThis assists with packages that are not yet ingested from an upstream, yet the feed owner wants\nto apply a specific behavior on the first ingestion."] + #[doc = ""] + #[doc = "See [`set_upstreaming_behavior`](super::super::npm::Client::set_upstreaming_behavior) for details of the arguments."] + pub fn set_upstreaming_behavior( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + body: impl Into, + project: impl Into, + ) -> set_upstreaming_behavior::RequestBuilder { + set_upstreaming_behavior::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get an unscoped npm package.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`download_package`](super::super::npm::Client::download_package) for details of the arguments."] + pub fn download_package( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> download_package::RequestBuilder { + download_package::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Get the Readme for a package version that has no npm scope.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_readme`](super::super::npm::Client::get_package_readme) for details of the arguments."] + pub fn get_package_readme( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> get_package_readme::RequestBuilder { + get_package_readme::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Update several packages from a single feed in a single request. The updates to the packages do not happen atomically.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_packages`](super::super::npm::Client::update_packages) for details of the arguments."] + pub fn update_packages( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> update_packages::RequestBuilder { + update_packages::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "Get information about a scoped package version in the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_scoped_package_version_from_recycle_bin`](super::super::npm::Client::get_scoped_package_version_from_recycle_bin) for details of the arguments."] + pub fn get_scoped_package_version_from_recycle_bin( + &self, + organization: impl Into, + feed_id: impl Into, + package_scope: impl Into, + unscoped_package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> get_scoped_package_version_from_recycle_bin::RequestBuilder + { + get_scoped_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_scope: package_scope.into(), + unscoped_package_name: unscoped_package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Restore a package version with an npm scope from the recycle bin to its feed.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`restore_scoped_package_version_from_recycle_bin`](super::super::npm::Client::restore_scoped_package_version_from_recycle_bin) for details of the arguments."] + pub fn restore_scoped_package_version_from_recycle_bin( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + package_scope: impl Into, + unscoped_package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> restore_scoped_package_version_from_recycle_bin::RequestBuilder + { + restore_scoped_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + package_scope: package_scope.into(), + unscoped_package_name: unscoped_package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Delete a package version with an npm scope from the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`delete_scoped_package_version_from_recycle_bin`](super::super::npm::Client::delete_scoped_package_version_from_recycle_bin) for details of the arguments."] + pub fn delete_scoped_package_version_from_recycle_bin( + &self, + organization: impl Into, + feed_id: impl Into, + package_scope: impl Into, + unscoped_package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> delete_scoped_package_version_from_recycle_bin::RequestBuilder + { + delete_scoped_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_scope: package_scope.into(), + unscoped_package_name: unscoped_package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Get information about an unscoped package version in the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_version_from_recycle_bin`](super::super::npm::Client::get_package_version_from_recycle_bin) for details of the arguments."] + pub fn get_package_version_from_recycle_bin( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> get_package_version_from_recycle_bin::RequestBuilder { + get_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Restore a package version without an npm scope from the recycle bin to its feed.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`restore_package_version_from_recycle_bin`](super::super::npm::Client::restore_package_version_from_recycle_bin) for details of the arguments."] + pub fn restore_package_version_from_recycle_bin( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> restore_package_version_from_recycle_bin::RequestBuilder + { + restore_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Delete a package version without an npm scope from the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`delete_package_version_from_recycle_bin`](super::super::npm::Client::delete_package_version_from_recycle_bin) for details of the arguments."] + pub fn delete_package_version_from_recycle_bin( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> delete_package_version_from_recycle_bin::RequestBuilder + { + delete_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Delete or restore several package versions from the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_recycle_bin_packages`](super::super::npm::Client::update_recycle_bin_packages) for details of the arguments."] + pub fn update_recycle_bin_packages( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> update_recycle_bin_packages::RequestBuilder { + update_recycle_bin_packages::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + } + } + pub mod nu_get { + use super::super::models; + use super::super::nu_get::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the upstreaming behavior of a package within the context of a feed"] + #[doc = ""] + #[doc = "See [`get_upstreaming_behavior`](super::super::nu_get::Client::get_upstreaming_behavior) for details of the arguments."] + pub fn get_upstreaming_behavior( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + project: impl Into, + ) -> get_upstreaming_behavior::RequestBuilder { + get_upstreaming_behavior::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + project: project.into(), + } + } + #[doc = "Set the upstreaming behavior of a package within the context of a feed\n\nThe package does not need to necessarily exist in the feed prior to setting the behavior.\nThis assists with packages that are not yet ingested from an upstream, yet the feed owner wants\nto apply a specific behavior on the first ingestion."] + #[doc = ""] + #[doc = "See [`set_upstreaming_behavior`](super::super::nu_get::Client::set_upstreaming_behavior) for details of the arguments."] + pub fn set_upstreaming_behavior( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + body: impl Into, + project: impl Into, + ) -> set_upstreaming_behavior::RequestBuilder { + set_upstreaming_behavior::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get information about a package version.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_version`](super::super::nu_get::Client::get_package_version) for details of the arguments."] + pub fn get_package_version( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> get_package_version::RequestBuilder { + get_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + show_deleted: None, + } + } + #[doc = "Set mutable state on a package version.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_package_version`](super::super::nu_get::Client::update_package_version) for details of the arguments."] + pub fn update_package_version( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> update_package_version::RequestBuilder { + update_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Send a package version from the feed to its paired recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`delete_package_version`](super::super::nu_get::Client::delete_package_version) for details of the arguments."] + pub fn delete_package_version( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> delete_package_version::RequestBuilder { + delete_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Download a package version directly.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`download_package`](super::super::nu_get::Client::download_package) for details of the arguments."] + pub fn download_package( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> download_package::RequestBuilder { + download_package::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + source_protocol_version: None, + } + } + #[doc = "Update several packages from a single feed in a single request. The updates to the packages do not happen atomically.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_package_versions`](super::super::nu_get::Client::update_package_versions) for details of the arguments."] + pub fn update_package_versions( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> update_package_versions::RequestBuilder { + update_package_versions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "View a package version's deletion/recycled status\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_version_from_recycle_bin`](super::super::nu_get::Client::get_package_version_from_recycle_bin) for details of the arguments."] + pub fn get_package_version_from_recycle_bin( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> get_package_version_from_recycle_bin::RequestBuilder { + get_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Restore a package version from a feed's recycle bin back into the active feed.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`restore_package_version_from_recycle_bin`](super::super::nu_get::Client::restore_package_version_from_recycle_bin) for details of the arguments."] + pub fn restore_package_version_from_recycle_bin( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> restore_package_version_from_recycle_bin::RequestBuilder + { + restore_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Delete a package version from a feed's recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`delete_package_version_from_recycle_bin`](super::super::nu_get::Client::delete_package_version_from_recycle_bin) for details of the arguments."] + pub fn delete_package_version_from_recycle_bin( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> delete_package_version_from_recycle_bin::RequestBuilder + { + delete_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Delete or restore several package versions from the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_recycle_bin_package_versions`](super::super::nu_get::Client::update_recycle_bin_package_versions) for details of the arguments."] + pub fn update_recycle_bin_package_versions( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> update_recycle_bin_package_versions::RequestBuilder { + update_recycle_bin_package_versions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + } + } + pub mod python { + use super::super::models; + use super::super::python::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the upstreaming behavior of a package within the context of a feed"] + #[doc = ""] + #[doc = "See [`get_upstreaming_behavior`](super::super::python::Client::get_upstreaming_behavior) for details of the arguments."] + pub fn get_upstreaming_behavior( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + project: impl Into, + ) -> get_upstreaming_behavior::RequestBuilder { + get_upstreaming_behavior::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + project: project.into(), + } + } + #[doc = "Set the upstreaming behavior of a package within the context of a feed\n\nThe package does not need to necessarily exist in the feed prior to setting the behavior.\nThis assists with packages that are not yet ingested from an upstream, yet the feed owner wants\nto apply a specific behavior on the first ingestion."] + #[doc = ""] + #[doc = "See [`set_upstreaming_behavior`](super::super::python::Client::set_upstreaming_behavior) for details of the arguments."] + pub fn set_upstreaming_behavior( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + body: impl Into, + project: impl Into, + ) -> set_upstreaming_behavior::RequestBuilder { + set_upstreaming_behavior::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get information about a package version.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_version`](super::super::python::Client::get_package_version) for details of the arguments."] + pub fn get_package_version( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> get_package_version::RequestBuilder { + get_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + show_deleted: None, + } + } + #[doc = "Update state for a package version.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_package_version`](super::super::python::Client::update_package_version) for details of the arguments."] + pub fn update_package_version( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> update_package_version::RequestBuilder { + update_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Delete a package version, moving it to the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`delete_package_version`](super::super::python::Client::delete_package_version) for details of the arguments."] + pub fn delete_package_version( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> delete_package_version::RequestBuilder { + delete_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Download a python package file directly. This API is intended for manual UI download options, not for programmatic access and scripting.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`download_package`](super::super::python::Client::download_package) for details of the arguments."] + pub fn download_package( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + file_name: impl Into, + project: impl Into, + ) -> download_package::RequestBuilder { + download_package::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + file_name: file_name.into(), + project: project.into(), + } + } + #[doc = "Update several packages from a single feed in a single request. The updates to the packages do not happen atomically.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_package_versions`](super::super::python::Client::update_package_versions) for details of the arguments."] + pub fn update_package_versions( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> update_package_versions::RequestBuilder { + update_package_versions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "Get information about a package version in the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_version_from_recycle_bin`](super::super::python::Client::get_package_version_from_recycle_bin) for details of the arguments."] + pub fn get_package_version_from_recycle_bin( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> get_package_version_from_recycle_bin::RequestBuilder { + get_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Restore a package version from the recycle bin to its associated feed.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`restore_package_version_from_recycle_bin`](super::super::python::Client::restore_package_version_from_recycle_bin) for details of the arguments."] + pub fn restore_package_version_from_recycle_bin( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> restore_package_version_from_recycle_bin::RequestBuilder + { + restore_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Delete a package version from the feed, moving it to the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`delete_package_version_from_recycle_bin`](super::super::python::Client::delete_package_version_from_recycle_bin) for details of the arguments."] + pub fn delete_package_version_from_recycle_bin( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> delete_package_version_from_recycle_bin::RequestBuilder + { + delete_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Delete or restore several package versions from the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_recycle_bin_package_versions`](super::super::python::Client::update_recycle_bin_package_versions) for details of the arguments."] + pub fn update_recycle_bin_package_versions( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> update_recycle_bin_package_versions::RequestBuilder { + update_recycle_bin_package_versions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + } + } + pub mod universal { + use super::super::models; + use super::super::universal::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Show information about a package version.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_version`](super::super::universal::Client::get_package_version) for details of the arguments."] + pub fn get_package_version( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> get_package_version::RequestBuilder { + get_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + show_deleted: None, + } + } + #[doc = "Update information for a package version.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_package_version`](super::super::universal::Client::update_package_version) for details of the arguments."] + pub fn update_package_version( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> update_package_version::RequestBuilder { + update_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Delete a package version from a feed's recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`delete_package_version`](super::super::universal::Client::delete_package_version) for details of the arguments."] + pub fn delete_package_version( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> delete_package_version::RequestBuilder { + delete_package_version::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Update several packages from a single feed in a single request. The updates to the packages do not happen atomically.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_package_versions`](super::super::universal::Client::update_package_versions) for details of the arguments."] + pub fn update_package_versions( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> update_package_versions::RequestBuilder { + update_package_versions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + #[doc = "Get information about a package version in the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`get_package_version_from_recycle_bin`](super::super::universal::Client::get_package_version_from_recycle_bin) for details of the arguments."] + pub fn get_package_version_from_recycle_bin( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> get_package_version_from_recycle_bin::RequestBuilder { + get_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Restore a package version from the recycle bin to its associated feed.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`restore_package_version_from_recycle_bin`](super::super::universal::Client::restore_package_version_from_recycle_bin) for details of the arguments."] + pub fn restore_package_version_from_recycle_bin( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> restore_package_version_from_recycle_bin::RequestBuilder + { + restore_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Delete a package version from the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`delete_package_version_from_recycle_bin`](super::super::universal::Client::delete_package_version_from_recycle_bin) for details of the arguments."] + pub fn delete_package_version_from_recycle_bin( + &self, + organization: impl Into, + feed_id: impl Into, + package_name: impl Into, + package_version: impl Into, + project: impl Into, + ) -> delete_package_version_from_recycle_bin::RequestBuilder + { + delete_package_version_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + feed_id: feed_id.into(), + package_name: package_name.into(), + package_version: package_version.into(), + project: project.into(), + } + } + #[doc = "Delete or restore several package versions from the recycle bin.\n\nThe project parameter must be supplied if the feed was created in a project.\nIf the feed is not associated with any project, omit the project parameter from the request."] + #[doc = ""] + #[doc = "See [`update_recycle_bin_package_versions`](super::super::universal::Client::update_recycle_bin_package_versions) for details of the arguments."] + pub fn update_recycle_bin_package_versions( + &self, + organization: impl Into, + body: impl Into, + feed_id: impl Into, + project: impl Into, + ) -> update_recycle_bin_package_versions::RequestBuilder { + update_recycle_bin_package_versions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + feed_id: feed_id.into(), + project: project.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/audit/mod.rs b/azure_devops_rust_api/src/audit/mod.rs index 3e42a291..3a21f87a 100644 --- a/azure_devops_rust_api/src/audit/mod.rs +++ b/azure_devops_rust_api/src/audit/mod.rs @@ -197,17 +197,54 @@ pub mod actions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) area_name: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Optional. Get actions scoped to area"] pub fn area_name(mut self, area_name: impl Into) -> Self { self.area_name = Some(area_name.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(area_name) = &this.area_name { + req.url_mut() + .query_pairs_mut() + .append_pair("areaName", area_name); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -216,9 +253,7 @@ pub mod actions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -230,29 +265,24 @@ pub mod actions { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -327,8 +357,12 @@ pub mod audit_log { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) start_time: Option, pub(crate) end_time: Option, @@ -336,7 +370,7 @@ pub mod audit_log { pub(crate) continuation_token: Option, pub(crate) skip_aggregation: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Start time of download window. Optional"] pub fn start_time(mut self, start_time: impl Into) -> Self { self.start_time = Some(start_time.into()); @@ -362,6 +396,61 @@ pub mod audit_log { self.skip_aggregation = Some(skip_aggregation); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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", &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", &formatted_date_time); + } + if let Some(batch_size) = &this.batch_size { + req.url_mut() + .query_pairs_mut() + .append_pair("batchSize", &batch_size.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(skip_aggregation) = &this.skip_aggregation { + req.url_mut() + .query_pairs_mut() + .append_pair("skipAggregation", &skip_aggregation.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -370,9 +459,7 @@ pub mod audit_log { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -384,52 +471,24 @@ pub mod audit_log { 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", &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", &formatted_date_time); - } - if let Some(batch_size) = &this.batch_size { - req.url_mut() - .query_pairs_mut() - .append_pair("batchSize", &batch_size.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(skip_aggregation) = &this.skip_aggregation { - req.url_mut() - .query_pairs_mut() - .append_pair("skipAggregation", &skip_aggregation.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -505,14 +564,18 @@ pub mod download_log { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) format: String, pub(crate) start_time: Option, pub(crate) end_time: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Start time of download window. Optional"] pub fn start_time(mut self, start_time: impl Into) -> Self { self.start_time = Some(start_time.into()); @@ -523,6 +586,50 @@ pub mod download_log { self.end_time = Some(end_time.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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", &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", &formatted_date_time); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -531,9 +638,7 @@ pub mod download_log { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -545,41 +650,24 @@ pub mod download_log { 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", &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", &formatted_date_time); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -738,10 +826,41 @@ pub mod streams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -751,9 +870,7 @@ pub mod streams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -765,24 +882,24 @@ pub mod streams { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -832,12 +949,48 @@ pub mod streams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::AuditStream, pub(crate) days_to_backfill: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -847,9 +1000,7 @@ pub mod streams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -861,29 +1012,24 @@ pub mod streams { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -933,11 +1079,43 @@ pub mod streams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::AuditStream, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -947,9 +1125,7 @@ pub mod streams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -961,25 +1137,24 @@ pub mod streams { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1029,11 +1204,43 @@ pub mod streams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) stream_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/audit/streams/{}", + self.client.endpoint(), + self.organization, + self.stream_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1043,9 +1250,7 @@ pub mod streams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1057,25 +1262,24 @@ pub mod streams { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/audit/streams/{}", - self.client.endpoint(), - self.organization, - self.stream_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1125,12 +1329,48 @@ pub mod streams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) stream_id: i32, pub(crate) status: models::AuditStreamStatus, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + let status = &this.status; + req.url_mut() + .query_pairs_mut() + .append_pair("status", &status.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/audit/streams/{}", + self.client.endpoint(), + self.organization, + self.stream_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1140,9 +1380,7 @@ pub mod streams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1154,29 +1392,24 @@ pub mod streams { auth_header, ); } - let status = &this.status; - req.url_mut() - .query_pairs_mut() - .append_pair("status", &status.to_string()); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/audit/streams/{}", - self.client.endpoint(), - self.organization, - self.stream_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1221,11 +1454,43 @@ pub mod streams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) stream_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/audit/streams/{}", + self.client.endpoint(), + self.organization, + self.stream_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1235,9 +1500,7 @@ pub mod streams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1249,25 +1512,24 @@ pub mod streams { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/audit/streams/{}", - self.client.endpoint(), - self.organization, - self.stream_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1287,3 +1549,254 @@ pub mod streams { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn actions_client(&self) -> actions::Client { + actions::Client(self.clone()) + } + pub fn audit_log_client(&self) -> audit_log::Client { + audit_log::Client(self.clone()) + } + pub fn download_log_client(&self) -> download_log::Client { + download_log::Client(self.clone()) + } + pub fn streams_client(&self) -> streams::Client { + streams::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod actions { + use super::super::actions::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all auditable actions filterable by area."] + #[doc = ""] + #[doc = "See [`list`](super::super::actions::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + area_name: None, + } + } + } + } + pub mod audit_log { + use super::super::audit_log::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Queries audit log entries"] + #[doc = ""] + #[doc = "See [`query`](super::super::audit_log::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + start_time: None, + end_time: None, + batch_size: None, + continuation_token: None, + skip_aggregation: None, + } + } + } + } + pub mod download_log { + use super::super::download_log::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Downloads audit log entries."] + #[doc = ""] + #[doc = "See [`download_log`](super::super::download_log::Client::download_log) for details of the arguments."] + pub fn download_log( + &self, + organization: impl Into, + format: impl Into, + ) -> download_log::RequestBuilder { + download_log::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + format: format.into(), + start_time: None, + end_time: None, + } + } + } + } + pub mod streams { + use super::super::models; + use super::super::streams::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Return all Audit Streams scoped to an organization"] + #[doc = ""] + #[doc = "See [`query_all_streams`](super::super::streams::Client::query_all_streams) for details of the arguments."] + pub fn query_all_streams( + &self, + organization: impl Into, + ) -> query_all_streams::RequestBuilder { + query_all_streams::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Create new Audit Stream"] + #[doc = ""] + #[doc = "See [`create`](super::super::streams::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + days_to_backfill: i32, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + days_to_backfill, + } + } + #[doc = "Update existing Audit Stream"] + #[doc = ""] + #[doc = "See [`update_stream`](super::super::streams::Client::update_stream) for details of the arguments."] + pub fn update_stream( + &self, + organization: impl Into, + body: impl Into, + ) -> update_stream::RequestBuilder { + update_stream::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Return Audit Stream with id of streamId if one exists otherwise throw"] + #[doc = ""] + #[doc = "See [`query_stream_by_id`](super::super::streams::Client::query_stream_by_id) for details of the arguments."] + pub fn query_stream_by_id( + &self, + organization: impl Into, + stream_id: i32, + ) -> query_stream_by_id::RequestBuilder { + query_stream_by_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + stream_id, + } + } + #[doc = "Update existing Audit Stream status"] + #[doc = ""] + #[doc = "See [`update_status`](super::super::streams::Client::update_status) for details of the arguments."] + pub fn update_status( + &self, + organization: impl Into, + stream_id: i32, + status: impl Into, + ) -> update_status::RequestBuilder { + update_status::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + stream_id, + status: status.into(), + } + } + #[doc = "Delete Audit Stream"] + #[doc = ""] + #[doc = "See [`delete`](super::super::streams::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + stream_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + stream_id, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/auth.rs b/azure_devops_rust_api/src/auth.rs index 860f5419..02edea6d 100644 --- a/azure_devops_rust_api/src/auth.rs +++ b/azure_devops_rust_api/src/auth.rs @@ -45,6 +45,26 @@ impl Credential { Credential::TokenCredential(token_credential) } + /// Returns the HTTP authorization header value containing the credential, + /// without requiring an async runtime. + /// + /// Only [`Credential::Unauthenticated`] and [`Credential::Pat`] are supported; + /// [`Credential::TokenCredential`] returns an error because acquiring a token is async. + pub fn http_authorization_header_blocking(&self) -> Result> { + match self { + Credential::Unauthenticated => Ok(None), + Credential::Pat(pat) => Ok(Some(Self::pat_authorization_header(pat))), + Credential::TokenCredential(_) => Err(azure_core::error::Error::with_message( + azure_core::error::ErrorKind::Credential, + "TokenCredential is not supported for blocking requests", + )), + } + } + + fn pat_authorization_header(pat: &str) -> String { + format!("Basic {}", BASE64_STANDARD.encode(format!(":{}", pat))) + } + /// Returns the HTTP authorization header value containing the credential. #[allow(dead_code)] pub(crate) async fn http_authorization_header( @@ -54,10 +74,7 @@ impl Credential { match self { Credential::Unauthenticated => Ok(None), // PAT tokens are passed using Basic authentication. - Credential::Pat(pat) => Ok(Some(format!( - "Basic {}", - BASE64_STANDARD.encode(format!(":{}", pat)) - ))), + Credential::Pat(pat) => Ok(Some(Self::pat_authorization_header(pat))), // OAuth tokens are passed using Bearer authentication. Credential::TokenCredential(token_credential) => { let token_response = diff --git a/azure_devops_rust_api/src/blocking.rs b/azure_devops_rust_api/src/blocking.rs new file mode 100644 index 00000000..f536fdbc --- /dev/null +++ b/azure_devops_rust_api/src/blocking.rs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +//! Blocking (non-`async`) API support. +//! +//! Each API module provides a `blocking::ClientBuilder`, which is supplied with an +//! [`HttpClient`] to send requests. Implementations are provided for +//! [`ureq`](https://docs.rs/ureq) (`ureq` feature) and +//! [`reqwest::blocking`](https://docs.rs/reqwest) (`reqwest_blocking` feature). +//! +//! ```no_run +//! use azure_devops_rust_api::{blocking::UreqClient, git, Credential}; +//! +//! let credential = Credential::from_pat(""); +//! let git_client = git::blocking::ClientBuilder::new(credential, UreqClient::new()).build(); +//! +//! let repos = git_client +//! .repositories_client() +//! .list("", "") +//! .send()? +//! .into_body()? +//! .value; +//! # Ok::<(), azure_core::Error>(()) +//! ``` +//! +//! Limitations: +//! - Only PAT and unauthenticated credentials are supported. +//! - Requests do not go through the `azure_core` pipeline, so no retry policy is applied. +//! - The `artifacts_download` module is async-only. + +use azure_core::http::{RawResponse, Request}; +use std::sync::LazyLock; + +/// `User-Agent` header value, in the same format as `azure_core` uses. +static USER_AGENT: LazyLock = LazyLock::new(|| { + // Like `azure_core`, omit the `azure_` crate name prefix. + let crate_name = env!("CARGO_PKG_NAME"); + let crate_name = crate_name.strip_prefix("azure_").unwrap_or(crate_name); + format!( + "azsdk-rust-{}/{} (blocking; {}; {})", + crate_name, + env!("CARGO_PKG_VERSION"), + std::env::consts::OS, + std::env::consts::ARCH + ) +}); + +/// A blocking HTTP client that can send an `azure_core` [`Request`]. +/// +/// Implementations should return a [`RawResponse`] for any HTTP status code; +/// error status codes are converted into errors by the caller. +pub trait HttpClient: Send + Sync { + /// Sends the request and returns the fully-buffered response. + fn execute(&self, request: &Request) -> azure_core::Result; +} + +/// Sends a request, converting error status codes into errors. +// Unused if no module with a blocking client is enabled. +#[allow(dead_code)] +pub(crate) fn send( + http_client: &dyn HttpClient, + request: &mut Request, +) -> azure_core::Result { + // Requests sent via the async pipeline get a `User-Agent` header from `azure_core`, + // so set an equivalent header here. + request.insert_header(azure_core::http::headers::USER_AGENT, USER_AGENT.as_str()); + let response = http_client.execute(request)?; + // `check_success` is async, but does no I/O on a fully-buffered `RawResponse`, + // so this completes immediately. It is used so that errors match the async API. + futures::executor::block_on(azure_core::http::check_success(response, None)) +} + +#[cfg(feature = "ureq")] +pub use self::ureq_client::UreqClient; + +#[cfg(feature = "reqwest_blocking")] +pub use self::reqwest_client::ReqwestBlockingClient; + +/// Helpers shared by the [`HttpClient`] implementations. +#[cfg(any(feature = "ureq", feature = "reqwest_blocking"))] +mod convert { + use azure_core::error::{Error, ErrorKind}; + use azure_core::http::{headers::Headers, Body, Request}; + + pub(super) fn io_error(e: impl std::error::Error + Send + Sync + 'static) -> Error { + Error::new(ErrorKind::Io, e) + } + + pub(super) fn request_body(request: &Request) -> azure_core::Result> { + match request.body() { + Body::Bytes(bytes) => Ok(bytes.to_vec()), + Body::SeekableStream(_) => Err(Error::with_message( + ErrorKind::Other, + "streaming request bodies are not supported by blocking clients", + )), + } + } + + /// Converts response headers, skipping any whose value is not valid UTF-8. + pub(super) fn response_headers<'a>( + headers: impl Iterator, + ) -> Headers { + let mut result = Headers::new(); + for (name, value) in headers { + if let Ok(value) = std::str::from_utf8(value) { + result.insert(name.to_owned(), value.to_owned()); + } + } + result + } +} + +#[cfg(feature = "ureq")] +mod ureq_client { + use super::convert::{io_error, request_body, response_headers}; + use super::HttpClient; + use azure_core::http::{RawResponse, Request, StatusCode}; + + /// [`HttpClient`] implementation using [`ureq`]. + #[derive(Clone)] + pub struct UreqClient { + agent: ureq::Agent, + } + + impl UreqClient { + /// Creates a new client with default configuration. + pub fn new() -> Self { + let agent = ureq::Agent::config_builder() + .http_status_as_error(false) + .build() + .into(); + Self { agent } + } + } + + impl Default for UreqClient { + fn default() -> Self { + Self::new() + } + } + + impl From for UreqClient { + /// Wraps an existing agent. The agent must be configured with + /// `http_status_as_error(false)`. + fn from(agent: ureq::Agent) -> Self { + Self { agent } + } + } + + impl HttpClient for UreqClient { + fn execute(&self, request: &Request) -> azure_core::Result { + let mut builder = ureq::http::Request::builder() + .method(request.method().as_ref()) + .uri(request.url().as_str()); + for (name, value) in request.headers().iter() { + builder = builder.header(name.as_str(), value.as_str()); + } + let http_request = builder.body(request_body(request)?).map_err(io_error)?; + + let mut response = self.agent.run(http_request).map_err(io_error)?; + + let status = StatusCode::from(response.status().as_u16()); + let headers = response_headers( + response + .headers() + .iter() + .map(|(name, value)| (name.as_str(), value.as_bytes())), + ); + let body = response + .body_mut() + .with_config() + .limit(u64::MAX) + .read_to_vec() + .map_err(io_error)?; + Ok(RawResponse::from_bytes(status, headers, body)) + } + } +} + +#[cfg(feature = "reqwest_blocking")] +mod reqwest_client { + use super::convert::{io_error, request_body, response_headers}; + use super::HttpClient; + use azure_core::http::{RawResponse, Request, StatusCode}; + + /// [`HttpClient`] implementation using [`reqwest::blocking`]. + /// + /// Note that `reqwest::blocking` must not be used from within an async runtime. + #[derive(Clone)] + pub struct ReqwestBlockingClient { + client: reqwest::blocking::Client, + } + + impl ReqwestBlockingClient { + /// Creates a new client with default configuration. + pub fn new() -> Self { + Self { + client: reqwest::blocking::Client::new(), + } + } + } + + impl Default for ReqwestBlockingClient { + fn default() -> Self { + Self::new() + } + } + + impl From for ReqwestBlockingClient { + /// Wraps an existing client. + fn from(client: reqwest::blocking::Client) -> Self { + Self { client } + } + } + + impl HttpClient for ReqwestBlockingClient { + fn execute(&self, request: &Request) -> azure_core::Result { + let method = reqwest::Method::from_bytes(request.method().as_ref().as_bytes()) + .map_err(io_error)?; + let mut builder = self.client.request(method, request.url().as_str()); + for (name, value) in request.headers().iter() { + builder = builder.header(name.as_str(), value.as_str()); + } + + let response = builder + .body(request_body(request)?) + .send() + .map_err(io_error)?; + + let status = StatusCode::from(response.status().as_u16()); + let headers = response_headers( + response + .headers() + .iter() + .map(|(name, value)| (name.as_str(), value.as_bytes())), + ); + let body = response.bytes().map_err(io_error)?; + Ok(RawResponse::from_bytes(status, headers, body)) + } + } +} diff --git a/azure_devops_rust_api/src/build/mod.rs b/azure_devops_rust_api/src/build/mod.rs index 5a5e081b..1c785fd2 100644 --- a/azure_devops_rust_api/src/build/mod.rs +++ b/azure_devops_rust_api/src/build/mod.rs @@ -346,13 +346,51 @@ pub mod artifacts { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) artifact_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let artifact_name = &this.artifact_name; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactName", artifact_name); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/artifacts?artifactName={}", + self.client.endpoint(), + self.organization, + self.project, + self.build_id, + self.artifact_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -362,9 +400,7 @@ pub mod artifacts { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -376,31 +412,24 @@ pub mod artifacts { auth_header, ); } - let artifact_name = &this.artifact_name; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactName", artifact_name); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/artifacts?artifactName={}", - self.client.endpoint(), - self.organization, - self.project, - self.build_id, - self.artifact_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -448,8 +477,12 @@ pub mod artifacts { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, @@ -457,6 +490,41 @@ pub mod artifacts { pub(crate) file_id: String, pub(crate) file_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let artifact_name = &this.artifact_name; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactName", artifact_name); + let file_id = &this.file_id; + req.url_mut() + .query_pairs_mut() + .append_pair("fileId", file_id); + let file_name = &this.file_name; + req.url_mut() + .query_pairs_mut() + .append_pair("fileName", file_name); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -466,9 +534,7 @@ pub mod artifacts { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -480,32 +546,24 @@ pub mod artifacts { auth_header, ); } - let artifact_name = &this.artifact_name; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactName", artifact_name); - let file_id = &this.file_id; - req.url_mut() - .query_pairs_mut() - .append_pair("fileId", file_id); - let file_name = &this.file_name; - req.url_mut() - .query_pairs_mut() - .append_pair("fileName", file_name); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -555,12 +613,45 @@ pub mod artifacts { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/artifacts", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -570,9 +661,7 @@ pub mod artifacts { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -584,26 +673,24 @@ pub mod artifacts { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/artifacts", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -653,13 +740,47 @@ pub mod artifacts { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::BuildArtifact, pub(crate) project: String, pub(crate) build_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/artifacts", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -669,9 +790,7 @@ pub mod artifacts { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -683,27 +802,24 @@ pub mod artifacts { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/artifacts", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -898,15 +1014,19 @@ pub mod leases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) user_owner_id: String, pub(crate) definition_id: Option, pub(crate) run_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "An optional parameter to limit the search to a specific pipeline definition."] pub fn definition_id(mut self, definition_id: i32) -> Self { self.definition_id = Some(definition_id); @@ -917,6 +1037,50 @@ pub mod leases { self.run_id = Some(run_id); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let user_owner_id = &this.user_owner_id; + req.url_mut() + .query_pairs_mut() + .append_pair("userOwnerId", user_owner_id); + if let Some(definition_id) = &this.definition_id { + req.url_mut() + .query_pairs_mut() + .append_pair("definitionId", &definition_id.to_string()); + } + if let Some(run_id) = &this.run_id { + req.url_mut() + .query_pairs_mut() + .append_pair("runId", &run_id.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases?userOwnerId={}", + self.client.endpoint(), + self.organization, + self.project, + self.user_owner_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -925,9 +1089,7 @@ pub mod leases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -939,40 +1101,24 @@ pub mod leases { auth_header, ); } - let user_owner_id = &this.user_owner_id; - req.url_mut() - .query_pairs_mut() - .append_pair("userOwnerId", user_owner_id); - if let Some(definition_id) = &this.definition_id { - req.url_mut() - .query_pairs_mut() - .append_pair("definitionId", &definition_id.to_string()); - } - if let Some(run_id) = &this.run_id { - req.url_mut() - .query_pairs_mut() - .append_pair("runId", &run_id.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases?userOwnerId={}", - self.client.endpoint(), - self.organization, - self.project, - self.user_owner_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1022,15 +1168,19 @@ pub mod leases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) owner_id: Option, pub(crate) definition_id: Option, pub(crate) run_id: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn owner_id(mut self, owner_id: impl Into) -> Self { self.owner_id = Some(owner_id.into()); self @@ -1045,6 +1195,50 @@ pub mod leases { self.run_id = Some(run_id); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(owner_id) = &this.owner_id { + req.url_mut() + .query_pairs_mut() + .append_pair("ownerId", owner_id); + } + if let Some(definition_id) = &this.definition_id { + req.url_mut() + .query_pairs_mut() + .append_pair("definitionId", &definition_id.to_string()); + } + if let Some(run_id) = &this.run_id { + req.url_mut() + .query_pairs_mut() + .append_pair("runId", &run_id.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases?", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1053,9 +1247,7 @@ pub mod leases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1067,40 +1259,24 @@ pub mod leases { auth_header, ); } - if let Some(owner_id) = &this.owner_id { - req.url_mut() - .query_pairs_mut() - .append_pair("ownerId", owner_id); - } - if let Some(definition_id) = &this.definition_id { - req.url_mut() - .query_pairs_mut() - .append_pair("definitionId", &definition_id.to_string()); - } - if let Some(run_id) = &this.run_id { - req.url_mut() - .query_pairs_mut() - .append_pair("runId", &run_id.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases?", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1150,12 +1326,48 @@ pub mod leases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) leases_to_fetch: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1165,9 +1377,7 @@ pub mod leases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1179,29 +1389,24 @@ pub mod leases { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1251,12 +1456,45 @@ pub mod leases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1266,9 +1504,7 @@ pub mod leases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1280,26 +1516,24 @@ pub mod leases { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1344,12 +1578,46 @@ pub mod leases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) ids: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let ids = &this.ids; + req.url_mut().query_pairs_mut().append_pair("ids", ids); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1359,9 +1627,7 @@ pub mod leases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1373,27 +1639,24 @@ pub mod leases { auth_header, ); } - let ids = &this.ids; - req.url_mut().query_pairs_mut().append_pair("ids", ids); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1446,12 +1709,45 @@ pub mod leases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) lease_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases/{}", + self.client.endpoint(), + self.organization, + self.project, + self.lease_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1461,9 +1757,7 @@ pub mod leases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1475,26 +1769,24 @@ pub mod leases { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases/{}", - self.client.endpoint(), - self.organization, - self.project, - self.lease_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1544,13 +1836,47 @@ pub mod leases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::RetentionLeaseUpdate, pub(crate) project: String, pub(crate) lease_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention/leases/{}", + self.client.endpoint(), + self.organization, + self.project, + self.lease_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1560,9 +1886,7 @@ pub mod leases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1574,27 +1898,24 @@ pub mod leases { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention/leases/{}", - self.client.endpoint(), - self.organization, - self.project, - self.lease_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1680,16 +2001,51 @@ pub mod controllers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) name: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn name(mut self, name: impl Into) -> Self { self.name = Some(name.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(name) = &this.name { + req.url_mut().query_pairs_mut().append_pair("name", name); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1698,9 +2054,7 @@ pub mod controllers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1712,27 +2066,24 @@ pub mod controllers { auth_header, ); } - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1782,11 +2133,43 @@ pub mod controllers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) controller_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/build/controllers/{}", + self.client.endpoint(), + self.organization, + self.controller_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1796,9 +2179,7 @@ pub mod controllers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1810,25 +2191,24 @@ pub mod controllers { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/build/controllers/{}", - self.client.endpoint(), - self.organization, - self.controller_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1898,10 +2278,41 @@ pub mod resource_usage { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1911,9 +2322,7 @@ pub mod resource_usage { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1925,24 +2334,24 @@ pub mod resource_usage { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2013,16 +2422,53 @@ pub mod history { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) days_to_lookback: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn days_to_lookback(mut self, days_to_lookback: i32) -> Self { self.days_to_lookback = Some(days_to_lookback); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2031,9 +2477,7 @@ pub mod history { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2045,29 +2489,24 @@ pub mod history { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2166,19 +2605,58 @@ pub mod badge { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, pub(crate) branch_name: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The name of the branch."] pub fn branch_name(mut self, branch_name: impl Into) -> Self { self.branch_name = Some(branch_name.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(branch_name) = &this.branch_name { + req.url_mut() + .query_pairs_mut() + .append_pair("branchName", branch_name); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/public/build/definitions/{}/{}/badge", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2187,9 +2665,7 @@ pub mod badge { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2201,31 +2677,24 @@ pub mod badge { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/public/build/definitions/{}/{}/badge", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2273,15 +2742,19 @@ pub mod badge { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) repo_type: String, pub(crate) repo_id: Option, pub(crate) branch_name: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The repository ID."] pub fn repo_id(mut self, repo_id: impl Into) -> Self { self.repo_id = Some(repo_id.into()); @@ -2292,6 +2765,46 @@ pub mod badge { self.branch_name = Some(branch_name.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(repo_id) = &this.repo_id { + req.url_mut() + .query_pairs_mut() + .append_pair("repoId", repo_id); + } + if let Some(branch_name) = &this.branch_name { + req.url_mut() + .query_pairs_mut() + .append_pair("branchName", branch_name); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/repos/{}/badge", + self.client.endpoint(), + self.organization, + self.project, + self.repo_type + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2300,9 +2813,7 @@ pub mod badge { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2314,36 +2825,24 @@ pub mod badge { auth_header, ); } - if let Some(repo_id) = &this.repo_id { - req.url_mut() - .query_pairs_mut() - .append_pair("repoId", repo_id); - } - if let Some(branch_name) = &this.branch_name { - req.url_mut() - .query_pairs_mut() - .append_pair("branchName", branch_name); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/repos/{}/badge", - self.client.endpoint(), - self.organization, - self.project, - self.repo_type - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2438,14 +2937,18 @@ pub mod authorizedresources { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) type_: Option, pub(crate) id: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn type_(mut self, type_: impl Into) -> Self { self.type_ = Some(type_.into()); self @@ -2454,6 +2957,41 @@ pub mod authorizedresources { self.id = Some(id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(type_) = &this.type_ { + req.url_mut().query_pairs_mut().append_pair("type", type_); + } + if let Some(id) = &this.id { + req.url_mut().query_pairs_mut().append_pair("id", id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/authorizedresources", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2462,9 +3000,7 @@ pub mod authorizedresources { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2476,31 +3012,24 @@ pub mod authorizedresources { auth_header, ); } - if let Some(type_) = &this.type_ { - req.url_mut().query_pairs_mut().append_pair("type", type_); - } - if let Some(id) = &this.id { - req.url_mut().query_pairs_mut().append_pair("id", id); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/authorizedresources", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2554,12 +3083,45 @@ pub mod authorizedresources { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/authorizedresources", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2569,9 +3131,7 @@ pub mod authorizedresources { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2583,26 +3143,24 @@ pub mod authorizedresources { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/authorizedresources", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2969,8 +3527,12 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definitions: Option, @@ -2994,7 +3556,7 @@ pub mod builds { pub(crate) repository_id: Option, pub(crate) repository_type: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A comma-delimited list of definition IDs. If specified, filters to builds for these definitions."] pub fn definitions(mut self, definitions: impl Into) -> Self { self.definitions = Some(definitions.into()); @@ -3098,6 +3660,138 @@ pub mod builds { self.repository_type = Some(repository_type.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(definitions) = &this.definitions { + req.url_mut() + .query_pairs_mut() + .append_pair("definitions", definitions); + } + if let Some(queues) = &this.queues { + req.url_mut() + .query_pairs_mut() + .append_pair("queues", queues); + } + if let Some(build_number) = &this.build_number { + req.url_mut() + .query_pairs_mut() + .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", &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", &formatted_date_time); + } + if let Some(requested_for) = &this.requested_for { + req.url_mut() + .query_pairs_mut() + .append_pair("requestedFor", requested_for); + } + if let Some(reason_filter) = &this.reason_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("reasonFilter", &reason_filter.to_string()); + } + if let Some(status_filter) = &this.status_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("statusFilter", &status_filter.to_string()); + } + if let Some(result_filter) = &this.result_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("resultFilter", &result_filter.to_string()); + } + if let Some(tag_filters) = &this.tag_filters { + req.url_mut() + .query_pairs_mut() + .append_pair("tagFilters", tag_filters); + } + if let Some(properties) = &this.properties { + req.url_mut() + .query_pairs_mut() + .append_pair("properties", properties); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(max_builds_per_definition) = &this.max_builds_per_definition { + req.url_mut().query_pairs_mut().append_pair( + "maxBuildsPerDefinition", + &max_builds_per_definition.to_string(), + ); + } + if let Some(deleted_filter) = &this.deleted_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("deletedFilter", &deleted_filter.to_string()); + } + if let Some(query_order) = &this.query_order { + req.url_mut() + .query_pairs_mut() + .append_pair("queryOrder", &query_order.to_string()); + } + if let Some(branch_name) = &this.branch_name { + req.url_mut() + .query_pairs_mut() + .append_pair("branchName", branch_name); + } + if let Some(build_ids) = &this.build_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("buildIds", build_ids); + } + if let Some(repository_id) = &this.repository_id { + req.url_mut() + .query_pairs_mut() + .append_pair("repositoryId", repository_id); + } + if let Some(repository_type) = &this.repository_type { + req.url_mut() + .query_pairs_mut() + .append_pair("repositoryType", repository_type); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3106,9 +3800,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3120,128 +3812,24 @@ pub mod builds { auth_header, ); } - if let Some(definitions) = &this.definitions { - req.url_mut() - .query_pairs_mut() - .append_pair("definitions", definitions); - } - if let Some(queues) = &this.queues { - req.url_mut() - .query_pairs_mut() - .append_pair("queues", queues); - } - if let Some(build_number) = &this.build_number { - req.url_mut() - .query_pairs_mut() - .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", &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", &formatted_date_time); - } - if let Some(requested_for) = &this.requested_for { - req.url_mut() - .query_pairs_mut() - .append_pair("requestedFor", requested_for); - } - if let Some(reason_filter) = &this.reason_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("reasonFilter", &reason_filter.to_string()); - } - if let Some(status_filter) = &this.status_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("statusFilter", &status_filter.to_string()); - } - if let Some(result_filter) = &this.result_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("resultFilter", &result_filter.to_string()); - } - if let Some(tag_filters) = &this.tag_filters { - req.url_mut() - .query_pairs_mut() - .append_pair("tagFilters", tag_filters); - } - if let Some(properties) = &this.properties { - req.url_mut() - .query_pairs_mut() - .append_pair("properties", properties); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(max_builds_per_definition) = &this.max_builds_per_definition { - req.url_mut().query_pairs_mut().append_pair( - "maxBuildsPerDefinition", - &max_builds_per_definition.to_string(), - ); - } - if let Some(deleted_filter) = &this.deleted_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("deletedFilter", &deleted_filter.to_string()); - } - if let Some(query_order) = &this.query_order { - req.url_mut() - .query_pairs_mut() - .append_pair("queryOrder", &query_order.to_string()); - } - if let Some(branch_name) = &this.branch_name { - req.url_mut() - .query_pairs_mut() - .append_pair("branchName", branch_name); - } - if let Some(build_ids) = &this.build_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("buildIds", build_ids); - } - if let Some(repository_id) = &this.repository_id { - req.url_mut() - .query_pairs_mut() - .append_pair("repositoryId", repository_id); - } - if let Some(repository_type) = &this.repository_type { - req.url_mut() - .query_pairs_mut() - .append_pair("repositoryType", repository_type); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3291,8 +3879,12 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Build, pub(crate) project: String, @@ -3301,7 +3893,7 @@ pub mod builds { pub(crate) source_build_id: Option, pub(crate) definition_id: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn ignore_warnings(mut self, ignore_warnings: bool) -> Self { self.ignore_warnings = Some(ignore_warnings); self @@ -3319,6 +3911,56 @@ pub mod builds { self.definition_id = Some(definition_id); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + if let Some(ignore_warnings) = &this.ignore_warnings { + req.url_mut() + .query_pairs_mut() + .append_pair("ignoreWarnings", &ignore_warnings.to_string()); + } + if let Some(check_in_ticket) = &this.check_in_ticket { + req.url_mut() + .query_pairs_mut() + .append_pair("checkInTicket", check_in_ticket); + } + if let Some(source_build_id) = &this.source_build_id { + req.url_mut() + .query_pairs_mut() + .append_pair("sourceBuildId", &source_build_id.to_string()); + } + if let Some(definition_id) = &this.definition_id { + req.url_mut() + .query_pairs_mut() + .append_pair("definitionId", &definition_id.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3327,9 +3969,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3341,46 +3981,24 @@ pub mod builds { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - if let Some(ignore_warnings) = &this.ignore_warnings { - req.url_mut() - .query_pairs_mut() - .append_pair("ignoreWarnings", &ignore_warnings.to_string()); - } - if let Some(check_in_ticket) = &this.check_in_ticket { - req.url_mut() - .query_pairs_mut() - .append_pair("checkInTicket", check_in_ticket); - } - if let Some(source_build_id) = &this.source_build_id { - req.url_mut() - .query_pairs_mut() - .append_pair("sourceBuildId", &source_build_id.to_string()); - } - if let Some(definition_id) = &this.definition_id { - req.url_mut() - .query_pairs_mut() - .append_pair("definitionId", &definition_id.to_string()); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3430,12 +4048,45 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3445,9 +4096,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3459,26 +4108,24 @@ pub mod builds { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3528,18 +4175,57 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) property_filters: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn property_filters(mut self, property_filters: impl Into) -> Self { self.property_filters = Some(property_filters.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(property_filters) = &this.property_filters { + req.url_mut() + .query_pairs_mut() + .append_pair("propertyFilters", property_filters); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3548,9 +4234,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3562,31 +4246,24 @@ pub mod builds { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3636,19 +4313,59 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Build, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) retry: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn retry(mut self, retry: bool) -> Self { self.retry = Some(retry); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3657,9 +4374,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3671,32 +4386,24 @@ pub mod builds { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3741,12 +4448,45 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3756,9 +4496,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3770,26 +4508,24 @@ pub mod builds { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3842,8 +4578,12 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, @@ -3851,7 +4591,7 @@ pub mod builds { pub(crate) top: Option, pub(crate) include_source_change: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { self.continuation_token = Some(continuation_token.into()); self @@ -3865,6 +4605,51 @@ pub mod builds { self.include_source_change = Some(include_source_change); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(include_source_change) = &this.include_source_change { + req.url_mut() + .query_pairs_mut() + .append_pair("includeSourceChange", &include_source_change.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/changes", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3873,9 +4658,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3887,42 +4670,24 @@ pub mod builds { auth_header, ); } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(include_source_change) = &this.include_source_change { - req.url_mut().query_pairs_mut().append_pair( - "includeSourceChange", - &include_source_change.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/changes", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3972,12 +4737,45 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/leases", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3987,9 +4785,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4001,26 +4797,24 @@ pub mod builds { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/leases", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4070,12 +4864,45 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/logs", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4085,9 +4912,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4099,26 +4924,24 @@ pub mod builds { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/logs", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4166,8 +4989,12 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, @@ -4175,7 +5002,7 @@ pub mod builds { pub(crate) start_line: Option, pub(crate) end_line: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The start line."] pub fn start_line(mut self, start_line: i64) -> Self { self.start_line = Some(start_line); @@ -4186,6 +5013,47 @@ pub mod builds { self.end_line = Some(end_line); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(start_line) = &this.start_line { + req.url_mut() + .query_pairs_mut() + .append_pair("startLine", &start_line.to_string()); + } + if let Some(end_line) = &this.end_line { + req.url_mut() + .query_pairs_mut() + .append_pair("endLine", &end_line.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/logs/{}", + self.client.endpoint(), + self.organization, + self.project, + self.build_id, + self.log_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4194,9 +5062,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4208,37 +5074,24 @@ pub mod builds { auth_header, ); } - if let Some(start_line) = &this.start_line { - req.url_mut() - .query_pairs_mut() - .append_pair("startLine", &start_line.to_string()); - } - if let Some(end_line) = &this.end_line { - req.url_mut() - .query_pairs_mut() - .append_pair("endLine", &end_line.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/logs/{}", - self.client.endpoint(), - self.organization, - self.project, - self.build_id, - self.log_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4288,19 +5141,58 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The maximum number of work items to return."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/workitems", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4309,9 +5201,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4323,31 +5213,24 @@ pub mod builds { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/workitems", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4397,20 +5280,60 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The maximum number of work items to return, or the number of commits to consider if no commit IDs are specified."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/workitems", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4419,9 +5342,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4433,32 +5354,24 @@ pub mod builds { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/workitems", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4508,15 +5421,19 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) from_build_id: Option, pub(crate) to_build_id: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The ID of the first build."] pub fn from_build_id(mut self, from_build_id: i32) -> Self { self.from_build_id = Some(from_build_id); @@ -4532,6 +5449,50 @@ pub mod builds { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(from_build_id) = &this.from_build_id { + req.url_mut() + .query_pairs_mut() + .append_pair("fromBuildId", &from_build_id.to_string()); + } + if let Some(to_build_id) = &this.to_build_id { + req.url_mut() + .query_pairs_mut() + .append_pair("toBuildId", &to_build_id.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/changes", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4540,9 +5501,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4554,40 +5513,24 @@ pub mod builds { auth_header, ); } - if let Some(from_build_id) = &this.from_build_id { - req.url_mut() - .query_pairs_mut() - .append_pair("fromBuildId", &from_build_id.to_string()); - } - if let Some(to_build_id) = &this.to_build_id { - req.url_mut() - .query_pairs_mut() - .append_pair("toBuildId", &to_build_id.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/changes", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4637,20 +5580,66 @@ pub mod builds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) from_build_id: i32, pub(crate) to_build_id: i32, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The maximum number of work items to return."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let from_build_id = &this.from_build_id; + req.url_mut() + .query_pairs_mut() + .append_pair("fromBuildId", &from_build_id.to_string()); + let to_build_id = &this.to_build_id; + req.url_mut() + .query_pairs_mut() + .append_pair("toBuildId", &to_build_id.to_string()); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/workitems", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4659,9 +5648,7 @@ pub mod builds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4673,38 +5660,24 @@ pub mod builds { auth_header, ); } - let from_build_id = &this.from_build_id; - req.url_mut() - .query_pairs_mut() - .append_pair("fromBuildId", &from_build_id.to_string()); - let to_build_id = &this.to_build_id; - req.url_mut() - .query_pairs_mut() - .append_pair("toBuildId", &to_build_id.to_string()); - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/workitems", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4815,8 +5788,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, @@ -4825,6 +5802,39 @@ pub mod attachments { pub(crate) type_: String, pub(crate) name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/{}/{}/attachments/{}/{}", + self.client.endpoint(), + self.organization, + self.project, + self.build_id, + self.timeline_id, + self.record_id, + self.type_, + self.name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4834,9 +5844,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4848,30 +5856,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/{}/{}/attachments/{}/{}", - self.client.endpoint(), - self.organization, - self.project, - self.build_id, - self.timeline_id, - self.record_id, - self.type_, - self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4921,13 +5923,47 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) type_: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/attachments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.build_id, + self.type_ + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4937,9 +5973,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4951,27 +5985,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/attachments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.build_id, - self.type_ - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5115,51 +6146,40 @@ pub mod properties { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) filter: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A comma-delimited list of properties. If specified, filters to these specific properties."] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - 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::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(filter) = &this.filter { + req.url_mut() + .query_pairs_mut() + .append_pair("filter", filter); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -5177,6 +6197,47 @@ pub mod properties { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -5224,13 +6285,47 @@ pub mod properties { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::JsonPatchDocument, pub(crate) project: String, pub(crate) build_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/properties", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5240,9 +6335,7 @@ pub mod properties { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5254,27 +6347,24 @@ pub mod properties { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/properties", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5324,19 +6414,58 @@ pub mod properties { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, pub(crate) filter: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A comma-delimited list of properties. If specified, filters to these specific properties."] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(filter) = &this.filter { + req.url_mut() + .query_pairs_mut() + .append_pair("filter", filter); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/properties", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5345,9 +6474,7 @@ pub mod properties { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5359,31 +6486,24 @@ pub mod properties { auth_header, ); } - if let Some(filter) = &this.filter { - req.url_mut() - .query_pairs_mut() - .append_pair("filter", filter); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/properties", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5433,13 +6553,47 @@ pub mod properties { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::JsonPatchDocument, pub(crate) project: String, pub(crate) definition_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/properties", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5449,9 +6603,7 @@ pub mod properties { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5463,27 +6615,24 @@ pub mod properties { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/properties", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5563,18 +6712,55 @@ pub mod report { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) type_: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn type_(mut self, type_: impl Into) -> Self { self.type_ = Some(type_.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(type_) = &this.type_ { + req.url_mut().query_pairs_mut().append_pair("type", type_); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/report", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5583,9 +6769,7 @@ pub mod report { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5597,29 +6781,24 @@ pub mod report { auth_header, ); } - if let Some(type_) = &this.type_ { - req.url_mut().query_pairs_mut().append_pair("type", type_); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/report", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5696,14 +6875,49 @@ pub mod stages { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UpdateStageParameters, pub(crate) build_id: i32, pub(crate) stage_ref_name: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/stages/{}", + self.client.endpoint(), + self.organization, + self.project, + self.build_id, + self.stage_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5713,9 +6927,7 @@ pub mod stages { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5727,28 +6939,24 @@ pub mod stages { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/stages/{}", - self.client.endpoint(), - self.organization, - self.project, - self.build_id, - self.stage_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6059,12 +7267,45 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/tags", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6074,9 +7315,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6088,26 +7327,24 @@ pub mod tags { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/tags", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6155,25 +7392,57 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) build_id: i32, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/tags", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6185,27 +7454,24 @@ pub mod tags { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/tags", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6253,13 +7519,47 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UpdateTagParameters, pub(crate) project: String, pub(crate) build_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/tags", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6269,9 +7569,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6283,27 +7581,24 @@ pub mod tags { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/tags", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6351,13 +7646,47 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) tag: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/tags/{}", + self.client.endpoint(), + self.organization, + self.project, + self.build_id, + self.tag + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6367,9 +7696,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6381,27 +7708,24 @@ pub mod tags { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/tags/{}", - self.client.endpoint(), - self.organization, - self.project, - self.build_id, - self.tag - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6449,13 +7773,47 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) tag: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/tags/{}", + self.client.endpoint(), + self.organization, + self.project, + self.build_id, + self.tag + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6465,9 +7823,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6479,27 +7835,24 @@ pub mod tags { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/tags/{}", - self.client.endpoint(), - self.organization, - self.project, - self.build_id, - self.tag - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6547,19 +7900,58 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, pub(crate) revision: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The definition revision number. If not specified, uses the latest revision of the definition."] pub fn revision(mut self, revision: i32) -> Self { self.revision = Some(revision); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(revision) = &this.revision { + req.url_mut() + .query_pairs_mut() + .append_pair("revision", &revision.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/tags", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6568,9 +7960,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6582,31 +7972,24 @@ pub mod tags { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/tags", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6654,13 +8037,47 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) definition_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/tags", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6670,9 +8087,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6684,27 +8099,24 @@ pub mod tags { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/tags", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6752,13 +8164,47 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UpdateTagParameters, pub(crate) project: String, pub(crate) definition_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/tags", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6768,9 +8214,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6782,27 +8226,24 @@ pub mod tags { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/tags", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6850,41 +8291,29 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, pub(crate) tag: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -6903,6 +8332,47 @@ pub mod tags { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result>; type IntoFuture = BoxFuture<'static, azure_core::Result>>; @@ -6948,13 +8418,47 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, pub(crate) tag: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/tags/{}", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id, + self.tag + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6964,9 +8468,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6978,27 +8480,24 @@ pub mod tags { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/tags/{}", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id, - self.tag - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7046,11 +8545,43 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/tags", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7060,9 +8591,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7074,25 +8603,24 @@ pub mod tags { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/tags", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7140,12 +8668,45 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) tag: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/tags/{}", + self.client.endpoint(), + self.organization, + self.project, + self.tag + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7155,9 +8716,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7169,26 +8728,24 @@ pub mod tags { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/tags/{}", - self.client.endpoint(), - self.organization, - self.project, - self.tag - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7270,8 +8827,12 @@ pub mod timeline { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, @@ -7279,7 +8840,7 @@ pub mod timeline { pub(crate) change_id: Option, pub(crate) plan_id: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn change_id(mut self, change_id: i32) -> Self { self.change_id = Some(change_id); self @@ -7288,6 +8849,47 @@ pub mod timeline { self.plan_id = Some(plan_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(change_id) = &this.change_id { + req.url_mut() + .query_pairs_mut() + .append_pair("changeId", &change_id.to_string()); + } + if let Some(plan_id) = &this.plan_id { + req.url_mut() + .query_pairs_mut() + .append_pair("planId", plan_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/builds/{}/timeline/{}", + self.client.endpoint(), + self.organization, + self.project, + self.build_id, + self.timeline_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7296,9 +8898,7 @@ pub mod timeline { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7310,37 +8910,24 @@ pub mod timeline { auth_header, ); } - if let Some(change_id) = &this.change_id { - req.url_mut() - .query_pairs_mut() - .append_pair("changeId", &change_id.to_string()); - } - if let Some(plan_id) = &this.plan_id { - req.url_mut() - .query_pairs_mut() - .append_pair("planId", plan_id); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/builds/{}/timeline/{}", - self.client.endpoint(), - self.organization, - self.project, - self.build_id, - self.timeline_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7563,8 +9150,12 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) name: Option, @@ -7584,7 +9175,7 @@ pub mod definitions { pub(crate) process_type: Option, pub(crate) yaml_filename: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If specified, filters to definitions whose names match this pattern."] pub fn name(mut self, name: impl Into) -> Self { self.name = Some(name.into()); @@ -7674,6 +9265,114 @@ pub mod definitions { self.yaml_filename = Some(yaml_filename.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(name) = &this.name { + req.url_mut().query_pairs_mut().append_pair("name", name); + } + if let Some(repository_id) = &this.repository_id { + req.url_mut() + .query_pairs_mut() + .append_pair("repositoryId", repository_id); + } + if let Some(repository_type) = &this.repository_type { + req.url_mut() + .query_pairs_mut() + .append_pair("repositoryType", repository_type); + } + if let Some(query_order) = &this.query_order { + req.url_mut() + .query_pairs_mut() + .append_pair("queryOrder", &query_order.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .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", &formatted_date_time); + } + if let Some(definition_ids) = &this.definition_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("definitionIds", definition_ids); + } + if let Some(path) = &this.path { + 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", &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", &formatted_date_time); + } + if let Some(include_all_properties) = &this.include_all_properties { + req.url_mut() + .query_pairs_mut() + .append_pair("includeAllProperties", &include_all_properties.to_string()); + } + if let Some(include_latest_builds) = &this.include_latest_builds { + req.url_mut() + .query_pairs_mut() + .append_pair("includeLatestBuilds", &include_latest_builds.to_string()); + } + if let Some(task_id_filter) = &this.task_id_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("taskIdFilter", task_id_filter); + } + if let Some(process_type) = &this.process_type { + req.url_mut() + .query_pairs_mut() + .append_pair("processType", &process_type.to_string()); + } + if let Some(yaml_filename) = &this.yaml_filename { + req.url_mut() + .query_pairs_mut() + .append_pair("yamlFilename", yaml_filename); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7682,9 +9381,7 @@ pub mod definitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7696,109 +9393,24 @@ pub mod definitions { auth_header, ); } - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - if let Some(repository_id) = &this.repository_id { - req.url_mut() - .query_pairs_mut() - .append_pair("repositoryId", repository_id); - } - if let Some(repository_type) = &this.repository_type { - req.url_mut() - .query_pairs_mut() - .append_pair("repositoryType", repository_type); - } - if let Some(query_order) = &this.query_order { - req.url_mut() - .query_pairs_mut() - .append_pair("queryOrder", &query_order.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .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", &formatted_date_time); - } - if let Some(definition_ids) = &this.definition_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("definitionIds", definition_ids); - } - if let Some(path) = &this.path { - 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", &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", &formatted_date_time); - } - if let Some(include_all_properties) = &this.include_all_properties { - req.url_mut().query_pairs_mut().append_pair( - "includeAllProperties", - &include_all_properties.to_string(), - ); - } - if let Some(include_latest_builds) = &this.include_latest_builds { - req.url_mut().query_pairs_mut().append_pair( - "includeLatestBuilds", - &include_latest_builds.to_string(), - ); - } - if let Some(task_id_filter) = &this.task_id_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("taskIdFilter", task_id_filter); - } - if let Some(process_type) = &this.process_type { - req.url_mut() - .query_pairs_mut() - .append_pair("processType", &process_type.to_string()); - } - if let Some(yaml_filename) = &this.yaml_filename { - req.url_mut() - .query_pairs_mut() - .append_pair("yamlFilename", yaml_filename); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7849,15 +9461,19 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::BuildDefinition, pub(crate) project: String, pub(crate) definition_to_clone_id: Option, pub(crate) definition_to_clone_revision: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn definition_to_clone_id(mut self, definition_to_clone_id: i32) -> Self { self.definition_to_clone_id = Some(definition_to_clone_id); self @@ -7869,17 +9485,56 @@ pub mod definitions { self.definition_to_clone_revision = Some(definition_to_clone_revision); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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", &definition_to_clone_id.to_string()); + } + if let Some(definition_to_clone_revision) = &this.definition_to_clone_revision { + req.url_mut().query_pairs_mut().append_pair( + "definitionToCloneRevision", + &definition_to_clone_revision.to_string(), + ); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] #[doc = "However, this function can provide more flexibility when required."] pub fn send(self) -> BoxFuture<'static, azure_core::Result> { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7891,40 +9546,24 @@ pub mod definitions { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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", - &definition_to_clone_id.to_string(), - ); - } - if let Some(definition_to_clone_revision) = - &this.definition_to_clone_revision - { - req.url_mut().query_pairs_mut().append_pair( - "definitionToCloneRevision", - &definition_to_clone_revision.to_string(), - ); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7974,8 +9613,12 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, @@ -7984,7 +9627,7 @@ pub mod definitions { pub(crate) property_filters: Option, pub(crate) include_latest_builds: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The revision number to retrieve. If this is not specified, the latest version will be returned."] pub fn revision(mut self, revision: i32) -> Self { self.revision = Some(revision); @@ -8007,6 +9650,57 @@ pub mod definitions { self.include_latest_builds = Some(include_latest_builds); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(revision) = &this.revision { + req.url_mut() + .query_pairs_mut() + .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", &formatted_date_time); + } + if let Some(property_filters) = &this.property_filters { + req.url_mut() + .query_pairs_mut() + .append_pair("propertyFilters", property_filters); + } + if let Some(include_latest_builds) = &this.include_latest_builds { + req.url_mut() + .query_pairs_mut() + .append_pair("includeLatestBuilds", &include_latest_builds.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8015,9 +9709,7 @@ pub mod definitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8029,49 +9721,24 @@ pub mod definitions { auth_header, ); } - if let Some(revision) = &this.revision { - req.url_mut() - .query_pairs_mut() - .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", &formatted_date_time); - } - if let Some(property_filters) = &this.property_filters { - req.url_mut() - .query_pairs_mut() - .append_pair("propertyFilters", property_filters); - } - if let Some(include_latest_builds) = &this.include_latest_builds { - req.url_mut().query_pairs_mut().append_pair( - "includeLatestBuilds", - &include_latest_builds.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8121,8 +9788,12 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::BuildDefinition, pub(crate) project: String, @@ -8130,7 +9801,7 @@ pub mod definitions { pub(crate) secrets_source_definition_id: Option, pub(crate) secrets_source_definition_revision: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn secrets_source_definition_id( mut self, secrets_source_definition_id: i32, @@ -8145,6 +9816,51 @@ pub mod definitions { self.secrets_source_definition_revision = Some(secrets_source_definition_revision); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + if let Some(secrets_source_definition_id) = &this.secrets_source_definition_id { + req.url_mut().query_pairs_mut().append_pair( + "secretsSourceDefinitionId", + &secrets_source_definition_id.to_string(), + ); + } + if let Some(secrets_source_definition_revision) = + &this.secrets_source_definition_revision + { + req.url_mut().query_pairs_mut().append_pair( + "secretsSourceDefinitionRevision", + &secrets_source_definition_revision.to_string(), + ); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8153,9 +9869,7 @@ pub mod definitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8167,43 +9881,24 @@ pub mod definitions { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - if let Some(secrets_source_definition_id) = - &this.secrets_source_definition_id - { - req.url_mut().query_pairs_mut().append_pair( - "secretsSourceDefinitionId", - &secrets_source_definition_id.to_string(), - ); - } - if let Some(secrets_source_definition_revision) = - &this.secrets_source_definition_revision - { - req.url_mut().query_pairs_mut().append_pair( - "secretsSourceDefinitionRevision", - &secrets_source_definition_revision.to_string(), - ); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8253,13 +9948,50 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, pub(crate) deleted: bool, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let deleted = &this.deleted; + req.url_mut() + .query_pairs_mut() + .append_pair("deleted", &deleted.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8269,9 +10001,7 @@ pub mod definitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8283,30 +10013,24 @@ pub mod definitions { auth_header, ); } - let deleted = &this.deleted; - req.url_mut() - .query_pairs_mut() - .append_pair("deleted", &deleted.to_string()); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8351,12 +10075,45 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8366,9 +10123,7 @@ pub mod definitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8380,26 +10135,24 @@ pub mod definitions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8455,12 +10208,45 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/revisions", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8470,9 +10256,7 @@ pub mod definitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8484,26 +10268,24 @@ pub mod definitions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/revisions", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8604,14 +10386,18 @@ pub mod metrics { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, pub(crate) min_metrics_time: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The date from which to calculate metrics."] pub fn min_metrics_time( mut self, @@ -8620,6 +10406,42 @@ pub mod metrics { self.min_metrics_time = Some(min_metrics_time.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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", &formatted_date_time); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/metrics", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8628,9 +10450,7 @@ pub mod metrics { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8642,33 +10462,24 @@ pub mod metrics { 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", &formatted_date_time); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/metrics", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8718,14 +10529,18 @@ pub mod metrics { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) metric_aggregation_type: String, pub(crate) min_metrics_time: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The date from which to calculate metrics."] pub fn min_metrics_time( mut self, @@ -8734,6 +10549,42 @@ pub mod metrics { self.min_metrics_time = Some(min_metrics_time.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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", &formatted_date_time); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/metrics/{}", + self.client.endpoint(), + self.organization, + self.project, + self.metric_aggregation_type + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8742,9 +10593,7 @@ pub mod metrics { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8756,33 +10605,24 @@ pub mod metrics { 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", &formatted_date_time); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/metrics/{}", - self.client.endpoint(), - self.organization, - self.project, - self.metric_aggregation_type - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8879,12 +10719,45 @@ pub mod resources { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/resources", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8894,9 +10767,7 @@ pub mod resources { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8908,26 +10779,24 @@ pub mod resources { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/resources", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8981,13 +10850,47 @@ pub mod resources { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) definition_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/resources", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8997,9 +10900,7 @@ pub mod resources { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9011,27 +10912,24 @@ pub mod resources { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/resources", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9115,8 +11013,12 @@ pub mod yaml { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, @@ -9125,7 +11027,7 @@ pub mod yaml { pub(crate) property_filters: Option, pub(crate) include_latest_builds: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The revision number to retrieve. If this is not specified, the latest version will be returned."] pub fn revision(mut self, revision: i32) -> Self { self.revision = Some(revision); @@ -9148,6 +11050,57 @@ pub mod yaml { self.include_latest_builds = Some(include_latest_builds); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(revision) = &this.revision { + req.url_mut() + .query_pairs_mut() + .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", &formatted_date_time); + } + if let Some(property_filters) = &this.property_filters { + req.url_mut() + .query_pairs_mut() + .append_pair("propertyFilters", property_filters); + } + if let Some(include_latest_builds) = &this.include_latest_builds { + req.url_mut() + .query_pairs_mut() + .append_pair("includeLatestBuilds", &include_latest_builds.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/{}/yaml", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -9156,9 +11109,7 @@ pub mod yaml { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9170,49 +11121,24 @@ pub mod yaml { auth_header, ); } - if let Some(revision) = &this.revision { - req.url_mut() - .query_pairs_mut() - .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", &formatted_date_time); - } - if let Some(property_filters) = &this.property_filters { - req.url_mut() - .query_pairs_mut() - .append_pair("propertyFilters", property_filters); - } - if let Some(include_latest_builds) = &this.include_latest_builds { - req.url_mut().query_pairs_mut().append_pair( - "includeLatestBuilds", - &include_latest_builds.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/{}/yaml", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9351,11 +11277,43 @@ pub mod templates { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/templates", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9365,9 +11323,7 @@ pub mod templates { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9379,25 +11335,24 @@ pub mod templates { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/templates", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9451,12 +11406,45 @@ pub mod templates { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) template_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/templates/{}", + self.client.endpoint(), + self.organization, + self.project, + self.template_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9466,9 +11454,7 @@ pub mod templates { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9480,26 +11466,24 @@ pub mod templates { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/templates/{}", - self.client.endpoint(), - self.organization, - self.project, - self.template_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9553,13 +11537,47 @@ pub mod templates { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::BuildDefinitionTemplate, pub(crate) project: String, pub(crate) template_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/templates/{}", + self.client.endpoint(), + self.organization, + self.project, + self.template_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9569,9 +11587,7 @@ pub mod templates { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9583,27 +11599,24 @@ pub mod templates { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/templates/{}", - self.client.endpoint(), - self.organization, - self.project, - self.template_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9649,12 +11662,45 @@ pub mod templates { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) template_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/definitions/templates/{}", + self.client.endpoint(), + self.organization, + self.project, + self.template_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9664,9 +11710,7 @@ pub mod templates { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9678,26 +11722,24 @@ pub mod templates { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/definitions/templates/{}", - self.client.endpoint(), - self.organization, - self.project, - self.template_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9843,13 +11885,48 @@ pub mod folders { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Folder, pub(crate) project: String, pub(crate) path: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/folders", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9859,9 +11936,7 @@ pub mod folders { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9873,28 +11948,24 @@ pub mod folders { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/folders", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9944,13 +12015,48 @@ pub mod folders { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Folder, pub(crate) project: String, pub(crate) path: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/folders", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9960,9 +12066,7 @@ pub mod folders { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9974,28 +12078,24 @@ pub mod folders { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/folders", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10040,12 +12140,46 @@ pub mod folders { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) path: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let path = &this.path; + req.url_mut().query_pairs_mut().append_pair("path", path); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/folders", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10055,9 +12189,7 @@ pub mod folders { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10069,27 +12201,24 @@ pub mod folders { auth_header, ); } - let path = &this.path; - req.url_mut().query_pairs_mut().append_pair("path", path); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/folders", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10142,19 +12271,58 @@ pub mod folders { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) path: String, pub(crate) query_order: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The order in which folders should be returned."] pub fn query_order(mut self, query_order: impl Into) -> Self { self.query_order = Some(query_order.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(query_order) = &this.query_order { + req.url_mut() + .query_pairs_mut() + .append_pair("queryOrder", &query_order.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/folders/{}", + self.client.endpoint(), + self.organization, + self.project, + self.path + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -10163,9 +12331,7 @@ pub mod folders { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10177,31 +12343,24 @@ pub mod folders { auth_header, ); } - if let Some(query_order) = &this.query_order { - req.url_mut() - .query_pairs_mut() - .append_pair("queryOrder", &query_order.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/folders/{}", - self.client.endpoint(), - self.organization, - self.project, - self.path - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10298,11 +12457,43 @@ pub mod general_settings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/generalsettings", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10312,9 +12503,7 @@ pub mod general_settings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10326,25 +12515,24 @@ pub mod general_settings { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/generalsettings", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10398,12 +12586,45 @@ pub mod general_settings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PipelineGeneralSettings, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/generalsettings", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10413,9 +12634,7 @@ pub mod general_settings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10427,26 +12646,24 @@ pub mod general_settings { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/generalsettings", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10527,19 +12744,58 @@ pub mod latest { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition: String, pub(crate) branch_name: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "optional parameter that indicates the specific branch to use. If not specified, the default branch is used."] pub fn branch_name(mut self, branch_name: impl Into) -> Self { self.branch_name = Some(branch_name.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(branch_name) = &this.branch_name { + req.url_mut() + .query_pairs_mut() + .append_pair("branchName", branch_name); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/latest/{}", + self.client.endpoint(), + self.organization, + self.project, + self.definition + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -10548,9 +12804,7 @@ pub mod latest { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10562,31 +12816,24 @@ pub mod latest { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/latest/{}", - self.client.endpoint(), - self.organization, - self.project, - self.definition - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10665,11 +12912,43 @@ pub mod options { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/options", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10679,9 +12958,7 @@ pub mod options { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10693,25 +12970,24 @@ pub mod options { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/options", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10809,11 +13085,43 @@ pub mod retention { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10823,9 +13131,7 @@ pub mod retention { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10837,25 +13143,24 @@ pub mod retention { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10909,12 +13214,45 @@ pub mod retention { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UpdateProjectRetentionSettingModel, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/retention", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10924,9 +13262,7 @@ pub mod retention { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10938,26 +13274,24 @@ pub mod retention { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/retention", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11053,11 +13387,43 @@ pub mod settings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/settings", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11067,9 +13433,7 @@ pub mod settings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11081,25 +13445,24 @@ pub mod settings { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/settings", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11149,12 +13512,45 @@ pub mod settings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::BuildSettings, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/settings", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11164,9 +13560,7 @@ pub mod settings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11178,26 +13572,24 @@ pub mod settings { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/settings", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11279,8 +13671,12 @@ pub mod status { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition: String, @@ -11290,7 +13686,7 @@ pub mod status { pub(crate) configuration: Option, pub(crate) label: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Only consider the most recent build for this branch. If not specified, the default branch is used."] pub fn branch_name(mut self, branch_name: impl Into) -> Self { self.branch_name = Some(branch_name.into()); @@ -11316,6 +13712,59 @@ pub mod status { self.label = Some(label.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(branch_name) = &this.branch_name { + req.url_mut() + .query_pairs_mut() + .append_pair("branchName", branch_name); + } + if let Some(stage_name) = &this.stage_name { + req.url_mut() + .query_pairs_mut() + .append_pair("stageName", stage_name); + } + if let Some(job_name) = &this.job_name { + req.url_mut() + .query_pairs_mut() + .append_pair("jobName", job_name); + } + if let Some(configuration) = &this.configuration { + req.url_mut() + .query_pairs_mut() + .append_pair("configuration", configuration); + } + if let Some(label) = &this.label { + req.url_mut().query_pairs_mut().append_pair("label", label); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/build/status/{}", + self.client.endpoint(), + self.organization, + self.project, + self.definition + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -11324,9 +13773,7 @@ pub mod status { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11338,49 +13785,24 @@ pub mod status { auth_header, ); } - if let Some(branch_name) = &this.branch_name { - req.url_mut() - .query_pairs_mut() - .append_pair("branchName", branch_name); - } - if let Some(stage_name) = &this.stage_name { - req.url_mut() - .query_pairs_mut() - .append_pair("stageName", stage_name); - } - if let Some(job_name) = &this.job_name { - req.url_mut() - .query_pairs_mut() - .append_pair("jobName", job_name); - } - if let Some(configuration) = &this.configuration { - req.url_mut() - .query_pairs_mut() - .append_pair("configuration", configuration); - } - if let Some(label) = &this.label { - req.url_mut().query_pairs_mut().append_pair("label", label); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/build/status/{}", - self.client.endpoint(), - self.organization, - self.project, - self.definition - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11620,11 +14042,43 @@ pub mod source_providers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/sourceproviders", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11634,9 +14088,7 @@ pub mod source_providers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11648,25 +14100,24 @@ pub mod source_providers { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/sourceproviders", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11715,8 +14166,12 @@ pub mod source_providers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) provider_name: String, @@ -11724,7 +14179,7 @@ pub mod source_providers { pub(crate) repository: Option, pub(crate) branch_name: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit."] pub fn service_endpoint_id(mut self, service_endpoint_id: impl Into) -> Self { self.service_endpoint_id = Some(service_endpoint_id.into()); @@ -11740,48 +14195,33 @@ pub mod source_providers { self.branch_name = Some(branch_name.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - if let Some(service_endpoint_id) = &this.service_endpoint_id { - req.url_mut() - .query_pairs_mut() - .append_pair("serviceEndpointId", service_endpoint_id); - } - if let Some(repository) = &this.repository { - req.url_mut() - .query_pairs_mut() - .append_pair("repository", repository); - } - if let Some(branch_name) = &this.branch_name { - req.url_mut() - .query_pairs_mut() - .append_pair("branchName", branch_name); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(service_endpoint_id) = &this.service_endpoint_id { + req.url_mut() + .query_pairs_mut() + .append_pair("serviceEndpointId", service_endpoint_id); + } + if let Some(repository) = &this.repository { + req.url_mut() + .query_pairs_mut() + .append_pair("repository", repository); + } + if let Some(branch_name) = &this.branch_name { + req.url_mut() + .query_pairs_mut() + .append_pair("branchName", branch_name); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -11799,6 +14239,47 @@ pub mod source_providers { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result>; type IntoFuture = BoxFuture<'static, azure_core::Result>>; @@ -11844,8 +14325,12 @@ pub mod source_providers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) provider_name: String, @@ -11854,7 +14339,7 @@ pub mod source_providers { pub(crate) commit_or_branch: Option, pub(crate) path: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit."] pub fn service_endpoint_id(mut self, service_endpoint_id: impl Into) -> Self { self.service_endpoint_id = Some(service_endpoint_id.into()); @@ -11875,6 +14360,54 @@ pub mod source_providers { self.path = Some(path.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(service_endpoint_id) = &this.service_endpoint_id { + req.url_mut() + .query_pairs_mut() + .append_pair("serviceEndpointId", service_endpoint_id); + } + if let Some(repository) = &this.repository { + req.url_mut() + .query_pairs_mut() + .append_pair("repository", repository); + } + if let Some(commit_or_branch) = &this.commit_or_branch { + req.url_mut() + .query_pairs_mut() + .append_pair("commitOrBranch", commit_or_branch); + } + if let Some(path) = &this.path { + req.url_mut().query_pairs_mut().append_pair("path", path); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/sourceProviders/{}/filecontents", + self.client.endpoint(), + self.organization, + self.project, + self.provider_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -11883,9 +14416,7 @@ pub mod source_providers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11897,44 +14428,24 @@ pub mod source_providers { auth_header, ); } - if let Some(service_endpoint_id) = &this.service_endpoint_id { - req.url_mut() - .query_pairs_mut() - .append_pair("serviceEndpointId", service_endpoint_id); - } - if let Some(repository) = &this.repository { - req.url_mut() - .query_pairs_mut() - .append_pair("repository", repository); - } - if let Some(commit_or_branch) = &this.commit_or_branch { - req.url_mut() - .query_pairs_mut() - .append_pair("commitOrBranch", commit_or_branch); - } - if let Some(path) = &this.path { - req.url_mut().query_pairs_mut().append_pair("path", path); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/sourceProviders/{}/filecontents", - self.client.endpoint(), - self.organization, - self.project, - self.provider_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11987,8 +14498,12 @@ pub mod source_providers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) provider_name: String, @@ -11997,7 +14512,7 @@ pub mod source_providers { pub(crate) commit_or_branch: Option, pub(crate) path: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit."] pub fn service_endpoint_id(mut self, service_endpoint_id: impl Into) -> Self { self.service_endpoint_id = Some(service_endpoint_id.into()); @@ -12018,6 +14533,54 @@ pub mod source_providers { self.path = Some(path.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(service_endpoint_id) = &this.service_endpoint_id { + req.url_mut() + .query_pairs_mut() + .append_pair("serviceEndpointId", service_endpoint_id); + } + if let Some(repository) = &this.repository { + req.url_mut() + .query_pairs_mut() + .append_pair("repository", repository); + } + if let Some(commit_or_branch) = &this.commit_or_branch { + req.url_mut() + .query_pairs_mut() + .append_pair("commitOrBranch", commit_or_branch); + } + if let Some(path) = &this.path { + req.url_mut().query_pairs_mut().append_pair("path", path); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/sourceProviders/{}/pathcontents", + self.client.endpoint(), + self.organization, + self.project, + self.provider_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -12026,9 +14589,7 @@ pub mod source_providers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12040,44 +14601,24 @@ pub mod source_providers { auth_header, ); } - if let Some(service_endpoint_id) = &this.service_endpoint_id { - req.url_mut() - .query_pairs_mut() - .append_pair("serviceEndpointId", service_endpoint_id); - } - if let Some(repository) = &this.repository { - req.url_mut() - .query_pairs_mut() - .append_pair("repository", repository); - } - if let Some(commit_or_branch) = &this.commit_or_branch { - req.url_mut() - .query_pairs_mut() - .append_pair("commitOrBranch", commit_or_branch); - } - if let Some(path) = &this.path { - req.url_mut().query_pairs_mut().append_pair("path", path); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/sourceProviders/{}/pathcontents", - self.client.endpoint(), - self.organization, - self.project, - self.provider_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12128,8 +14669,12 @@ pub mod source_providers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) provider_name: String, @@ -12137,7 +14682,7 @@ pub mod source_providers { pub(crate) repository_id: Option, pub(crate) service_endpoint_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Vendor-specific identifier or the name of the repository that contains the pull request."] pub fn repository_id(mut self, repository_id: impl Into) -> Self { self.repository_id = Some(repository_id.into()); @@ -12148,6 +14693,47 @@ pub mod source_providers { self.service_endpoint_id = Some(service_endpoint_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(repository_id) = &this.repository_id { + req.url_mut() + .query_pairs_mut() + .append_pair("repositoryId", repository_id); + } + if let Some(service_endpoint_id) = &this.service_endpoint_id { + req.url_mut() + .query_pairs_mut() + .append_pair("serviceEndpointId", service_endpoint_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/sourceProviders/{}/pullrequests/{}", + self.client.endpoint(), + self.organization, + self.project, + self.provider_name, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -12156,9 +14742,7 @@ pub mod source_providers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12170,37 +14754,24 @@ pub mod source_providers { auth_header, ); } - if let Some(repository_id) = &this.repository_id { - req.url_mut() - .query_pairs_mut() - .append_pair("repositoryId", repository_id); - } - if let Some(service_endpoint_id) = &this.service_endpoint_id { - req.url_mut() - .query_pairs_mut() - .append_pair("serviceEndpointId", service_endpoint_id); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/sourceProviders/{}/pullrequests/{}", - self.client.endpoint(), - self.organization, - self.project, - self.provider_name, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12250,8 +14821,12 @@ pub mod source_providers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) provider_name: String, @@ -12261,7 +14836,7 @@ pub mod source_providers { pub(crate) page_results: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit."] pub fn service_endpoint_id(mut self, service_endpoint_id: impl Into) -> Self { self.service_endpoint_id = Some(service_endpoint_id.into()); @@ -12287,6 +14862,61 @@ pub mod source_providers { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(service_endpoint_id) = &this.service_endpoint_id { + req.url_mut() + .query_pairs_mut() + .append_pair("serviceEndpointId", service_endpoint_id); + } + if let Some(repository) = &this.repository { + req.url_mut() + .query_pairs_mut() + .append_pair("repository", repository); + } + if let Some(result_set) = &this.result_set { + req.url_mut() + .query_pairs_mut() + .append_pair("resultSet", &result_set.to_string()); + } + if let Some(page_results) = &this.page_results { + req.url_mut() + .query_pairs_mut() + .append_pair("pageResults", &page_results.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/sourceProviders/{}/repositories", + self.client.endpoint(), + self.organization, + self.project, + self.provider_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -12295,9 +14925,7 @@ pub mod source_providers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12309,51 +14937,24 @@ pub mod source_providers { auth_header, ); } - if let Some(service_endpoint_id) = &this.service_endpoint_id { - req.url_mut() - .query_pairs_mut() - .append_pair("serviceEndpointId", service_endpoint_id); - } - if let Some(repository) = &this.repository { - req.url_mut() - .query_pairs_mut() - .append_pair("repository", repository); - } - if let Some(result_set) = &this.result_set { - req.url_mut() - .query_pairs_mut() - .append_pair("resultSet", &result_set.to_string()); - } - if let Some(page_results) = &this.page_results { - req.url_mut() - .query_pairs_mut() - .append_pair("pageResults", &page_results.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/sourceProviders/{}/repositories", - self.client.endpoint(), - self.organization, - self.project, - self.provider_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12403,15 +15004,19 @@ pub mod source_providers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) provider_name: String, pub(crate) service_endpoint_id: Option, pub(crate) repository: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit."] pub fn service_endpoint_id(mut self, service_endpoint_id: impl Into) -> Self { self.service_endpoint_id = Some(service_endpoint_id.into()); @@ -12422,6 +15027,46 @@ pub mod source_providers { self.repository = Some(repository.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(service_endpoint_id) = &this.service_endpoint_id { + req.url_mut() + .query_pairs_mut() + .append_pair("serviceEndpointId", service_endpoint_id); + } + if let Some(repository) = &this.repository { + req.url_mut() + .query_pairs_mut() + .append_pair("repository", repository); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/sourceProviders/{}/webhooks", + self.client.endpoint(), + self.organization, + self.project, + self.provider_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -12430,9 +15075,7 @@ pub mod source_providers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12444,36 +15087,24 @@ pub mod source_providers { auth_header, ); } - if let Some(service_endpoint_id) = &this.service_endpoint_id { - req.url_mut() - .query_pairs_mut() - .append_pair("serviceEndpointId", service_endpoint_id); - } - if let Some(repository) = &this.repository { - req.url_mut() - .query_pairs_mut() - .append_pair("repository", repository); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/sourceProviders/{}/webhooks", - self.client.endpoint(), - self.organization, - self.project, - self.provider_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12518,8 +15149,12 @@ pub mod source_providers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, @@ -12527,7 +15162,7 @@ pub mod source_providers { pub(crate) service_endpoint_id: Option, pub(crate) repository: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit."] pub fn service_endpoint_id(mut self, service_endpoint_id: impl Into) -> Self { self.service_endpoint_id = Some(service_endpoint_id.into()); @@ -12538,6 +15173,47 @@ pub mod source_providers { self.repository = Some(repository.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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() + .append_pair("serviceEndpointId", service_endpoint_id); + } + if let Some(repository) = &this.repository { + req.url_mut() + .query_pairs_mut() + .append_pair("repository", repository); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/sourceProviders/{}/webhooks", + self.client.endpoint(), + self.organization, + self.project, + self.provider_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -12546,9 +15222,7 @@ pub mod source_providers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12560,37 +15234,24 @@ pub mod source_providers { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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() - .append_pair("serviceEndpointId", service_endpoint_id); - } - if let Some(repository) = &this.repository { - req.url_mut() - .query_pairs_mut() - .append_pair("repository", repository); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/sourceProviders/{}/webhooks", - self.client.endpoint(), - self.organization, - self.project, - self.provider_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12610,3 +15271,1949 @@ pub mod source_providers { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn artifacts_client(&self) -> artifacts::Client { + artifacts::Client(self.clone()) + } + pub fn attachments_client(&self) -> attachments::Client { + attachments::Client(self.clone()) + } + pub fn authorizedresources_client(&self) -> authorizedresources::Client { + authorizedresources::Client(self.clone()) + } + pub fn badge_client(&self) -> badge::Client { + badge::Client(self.clone()) + } + pub fn builds_client(&self) -> builds::Client { + builds::Client(self.clone()) + } + pub fn controllers_client(&self) -> controllers::Client { + controllers::Client(self.clone()) + } + pub fn definitions_client(&self) -> definitions::Client { + definitions::Client(self.clone()) + } + pub fn folders_client(&self) -> folders::Client { + folders::Client(self.clone()) + } + pub fn general_settings_client(&self) -> general_settings::Client { + general_settings::Client(self.clone()) + } + pub fn history_client(&self) -> history::Client { + history::Client(self.clone()) + } + pub fn latest_client(&self) -> latest::Client { + latest::Client(self.clone()) + } + pub fn leases_client(&self) -> leases::Client { + leases::Client(self.clone()) + } + pub fn metrics_client(&self) -> metrics::Client { + metrics::Client(self.clone()) + } + pub fn options_client(&self) -> options::Client { + options::Client(self.clone()) + } + pub fn properties_client(&self) -> properties::Client { + properties::Client(self.clone()) + } + pub fn report_client(&self) -> report::Client { + report::Client(self.clone()) + } + pub fn resource_usage_client(&self) -> resource_usage::Client { + resource_usage::Client(self.clone()) + } + pub fn resources_client(&self) -> resources::Client { + resources::Client(self.clone()) + } + pub fn retention_client(&self) -> retention::Client { + retention::Client(self.clone()) + } + pub fn settings_client(&self) -> settings::Client { + settings::Client(self.clone()) + } + pub fn source_providers_client(&self) -> source_providers::Client { + source_providers::Client(self.clone()) + } + pub fn stages_client(&self) -> stages::Client { + stages::Client(self.clone()) + } + pub fn status_client(&self) -> status::Client { + status::Client(self.clone()) + } + pub fn tags_client(&self) -> tags::Client { + tags::Client(self.clone()) + } + pub fn templates_client(&self) -> templates::Client { + templates::Client(self.clone()) + } + pub fn timeline_client(&self) -> timeline::Client { + timeline::Client(self.clone()) + } + pub fn yaml_client(&self) -> yaml::Client { + yaml::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod artifacts { + use super::super::artifacts::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a specific artifact for a build."] + #[doc = ""] + #[doc = "See [`get_artifact`](super::super::artifacts::Client::get_artifact) for details of the arguments."] + pub fn get_artifact( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + artifact_name: impl Into, + ) -> get_artifact::RequestBuilder { + get_artifact::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + artifact_name: artifact_name.into(), + } + } + #[doc = "Gets a file from the build."] + #[doc = ""] + #[doc = "See [`get_file`](super::super::artifacts::Client::get_file) for details of the arguments."] + pub fn get_file( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + artifact_name: impl Into, + file_id: impl Into, + file_name: impl Into, + ) -> get_file::RequestBuilder { + get_file::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + artifact_name: artifact_name.into(), + file_id: file_id.into(), + file_name: file_name.into(), + } + } + #[doc = "Gets all artifacts for a build."] + #[doc = ""] + #[doc = "See [`list`](super::super::artifacts::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + } + } + #[doc = "Associates an artifact with a build."] + #[doc = ""] + #[doc = "See [`create`](super::super::artifacts::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + build_id: i32, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + build_id, + } + } + } + } + pub mod leases { + use super::super::leases::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns any leases owned by the specified user, optionally scoped to a single pipeline definition and run."] + #[doc = ""] + #[doc = "See [`get_retention_leases_by_user_id`](super::super::leases::Client::get_retention_leases_by_user_id) for details of the arguments."] + pub fn get_retention_leases_by_user_id( + &self, + organization: impl Into, + project: impl Into, + user_owner_id: impl Into, + ) -> get_retention_leases_by_user_id::RequestBuilder { + get_retention_leases_by_user_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + user_owner_id: user_owner_id.into(), + definition_id: None, + run_id: None, + } + } + #[doc = "Returns any leases owned by the specified entity, optionally scoped to a single pipeline definition and run."] + #[doc = ""] + #[doc = "See [`get_retention_leases_by_owner_id`](super::super::leases::Client::get_retention_leases_by_owner_id) for details of the arguments."] + pub fn get_retention_leases_by_owner_id( + &self, + organization: impl Into, + project: impl Into, + ) -> get_retention_leases_by_owner_id::RequestBuilder { + get_retention_leases_by_owner_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + owner_id: None, + definition_id: None, + run_id: None, + } + } + #[doc = "Returns any leases matching the specified MinimalRetentionLeases"] + #[doc = ""] + #[doc = "See [`get_retention_leases_by_minimal_retention_leases`](super::super::leases::Client::get_retention_leases_by_minimal_retention_leases) for details of the arguments."] + pub fn get_retention_leases_by_minimal_retention_leases( + &self, + organization: impl Into, + project: impl Into, + leases_to_fetch: impl Into, + ) -> get_retention_leases_by_minimal_retention_leases::RequestBuilder + { + get_retention_leases_by_minimal_retention_leases::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + leases_to_fetch: leases_to_fetch.into(), + } + } + #[doc = "Adds new leases for pipeline runs."] + #[doc = ""] + #[doc = "See [`add`](super::super::leases::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + } + } + #[doc = "Removes specific retention leases."] + #[doc = ""] + #[doc = "See [`delete`](super::super::leases::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + ids: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + ids: ids.into(), + } + } + #[doc = "Returns the details of the retention lease given a lease id."] + #[doc = ""] + #[doc = "See [`get`](super::super::leases::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + lease_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + lease_id, + } + } + #[doc = "Updates the duration or pipeline protection status of a retention lease."] + #[doc = ""] + #[doc = "See [`update`](super::super::leases::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + lease_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + lease_id, + } + } + } + } + pub mod controllers { + use super::super::controllers::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets controller, optionally filtered by name"] + #[doc = ""] + #[doc = "See [`list`](super::super::controllers::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + name: None, + } + } + #[doc = "Gets a controller"] + #[doc = ""] + #[doc = "See [`get`](super::super::controllers::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + controller_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + controller_id, + } + } + } + } + pub mod resource_usage { + use super::super::models; + use super::super::resource_usage::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets information about build resources in the system."] + #[doc = ""] + #[doc = "See [`get`](super::super::resource_usage::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + } + } + pub mod history { + use super::super::history::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns the retention history for the project collection. This includes pipelines that have custom retention rules that may prevent the retention job from cleaning them up, runs per pipeline with retention type, files associated with pipelines owned by the collection with retention type, and the number of files per pipeline."] + #[doc = ""] + #[doc = "See [`get`](super::super::history::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + days_to_lookback: None, + } + } + } + } + pub mod badge { + use super::super::badge::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "This endpoint is deprecated. Please see the Build Status REST endpoint."] + #[doc = ""] + #[doc = "See [`get`](super::super::badge::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + branch_name: None, + } + } + #[doc = "Gets a badge that indicates the status of the most recent build for the specified branch."] + #[doc = ""] + #[doc = "See [`get_build_badge_data`](super::super::badge::Client::get_build_badge_data) for details of the arguments."] + pub fn get_build_badge_data( + &self, + organization: impl Into, + project: impl Into, + repo_type: impl Into, + ) -> get_build_badge_data::RequestBuilder { + get_build_badge_data::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + repo_type: repo_type.into(), + repo_id: None, + branch_name: None, + } + } + } + } + pub mod authorizedresources { + use super::super::authorizedresources::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`list`](super::super::authorizedresources::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + type_: None, + id: None, + } + } + #[doc = "See [`authorize_project_resources`](super::super::authorizedresources::Client::authorize_project_resources) for details of the arguments."] + pub fn authorize_project_resources( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + ) -> authorize_project_resources::RequestBuilder { + authorize_project_resources::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + } + } + } + } + pub mod builds { + use super::super::builds::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of builds."] + #[doc = ""] + #[doc = "See [`list`](super::super::builds::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definitions: None, + queues: None, + build_number: None, + min_time: None, + max_time: None, + requested_for: None, + reason_filter: None, + status_filter: None, + result_filter: None, + tag_filters: None, + properties: None, + top: None, + continuation_token: None, + max_builds_per_definition: None, + deleted_filter: None, + query_order: None, + branch_name: None, + build_ids: None, + repository_id: None, + repository_type: None, + } + } + #[doc = "Queues a build"] + #[doc = ""] + #[doc = "See [`queue`](super::super::builds::Client::queue) for details of the arguments."] + pub fn queue( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> queue::RequestBuilder { + queue::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + ignore_warnings: None, + check_in_ticket: None, + source_build_id: None, + definition_id: None, + } + } + #[doc = "Updates multiple builds."] + #[doc = ""] + #[doc = "See [`update_builds`](super::super::builds::Client::update_builds) for details of the arguments."] + pub fn update_builds( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + ) -> update_builds::RequestBuilder { + update_builds::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + } + } + #[doc = "Gets a build"] + #[doc = ""] + #[doc = "See [`get`](super::super::builds::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + property_filters: None, + } + } + #[doc = "Updates a build."] + #[doc = ""] + #[doc = "See [`update_build`](super::super::builds::Client::update_build) for details of the arguments."] + pub fn update_build( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + build_id: i32, + ) -> update_build::RequestBuilder { + update_build::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + build_id, + retry: None, + } + } + #[doc = "Deletes a build."] + #[doc = ""] + #[doc = "See [`delete`](super::super::builds::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + } + } + #[doc = "Gets the changes associated with a build"] + #[doc = ""] + #[doc = "See [`get_build_changes`](super::super::builds::Client::get_build_changes) for details of the arguments."] + pub fn get_build_changes( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> get_build_changes::RequestBuilder { + get_build_changes::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + continuation_token: None, + top: None, + include_source_change: None, + } + } + #[doc = "Gets all retention leases that apply to a specific build."] + #[doc = ""] + #[doc = "See [`get_retention_leases_for_build`](super::super::builds::Client::get_retention_leases_for_build) for details of the arguments."] + pub fn get_retention_leases_for_build( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> get_retention_leases_for_build::RequestBuilder { + get_retention_leases_for_build::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + } + } + #[doc = "Gets the logs for a build."] + #[doc = ""] + #[doc = "See [`get_build_logs`](super::super::builds::Client::get_build_logs) for details of the arguments."] + pub fn get_build_logs( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> get_build_logs::RequestBuilder { + get_build_logs::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + } + } + #[doc = "Gets an individual log file for a build."] + #[doc = ""] + #[doc = "See [`get_build_log`](super::super::builds::Client::get_build_log) for details of the arguments."] + pub fn get_build_log( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + log_id: i32, + ) -> get_build_log::RequestBuilder { + get_build_log::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + log_id, + start_line: None, + end_line: None, + } + } + #[doc = "Gets the work items associated with a build. Only work items in the same project are returned."] + #[doc = ""] + #[doc = "See [`get_build_work_items_refs`](super::super::builds::Client::get_build_work_items_refs) for details of the arguments."] + pub fn get_build_work_items_refs( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> get_build_work_items_refs::RequestBuilder { + get_build_work_items_refs::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + top: None, + } + } + #[doc = "Gets the work items associated with a build, filtered to specific commits."] + #[doc = ""] + #[doc = "See [`get_build_work_items_refs_from_commits`](super::super::builds::Client::get_build_work_items_refs_from_commits) for details of the arguments."] + pub fn get_build_work_items_refs_from_commits( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + build_id: i32, + ) -> get_build_work_items_refs_from_commits::RequestBuilder { + get_build_work_items_refs_from_commits::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + build_id, + top: None, + } + } + #[doc = "Gets the changes made to the repository between two given builds."] + #[doc = ""] + #[doc = "See [`get_changes_between_builds`](super::super::builds::Client::get_changes_between_builds) for details of the arguments."] + pub fn get_changes_between_builds( + &self, + organization: impl Into, + project: impl Into, + ) -> get_changes_between_builds::RequestBuilder { + get_changes_between_builds::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + from_build_id: None, + to_build_id: None, + top: None, + } + } + #[doc = "Gets all the work items between two builds."] + #[doc = ""] + #[doc = "See [`get_work_items_between_builds`](super::super::builds::Client::get_work_items_between_builds) for details of the arguments."] + pub fn get_work_items_between_builds( + &self, + organization: impl Into, + project: impl Into, + from_build_id: i32, + to_build_id: i32, + ) -> get_work_items_between_builds::RequestBuilder { + get_work_items_between_builds::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + from_build_id, + to_build_id, + top: None, + } + } + } + } + pub mod attachments { + use super::super::attachments::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a specific attachment."] + #[doc = ""] + #[doc = "See [`get`](super::super::attachments::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + timeline_id: impl Into, + record_id: impl Into, + type_: impl Into, + name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + timeline_id: timeline_id.into(), + record_id: record_id.into(), + type_: type_.into(), + name: name.into(), + } + } + #[doc = "Gets the list of attachments of a specific type that are associated with a build."] + #[doc = ""] + #[doc = "See [`list`](super::super::attachments::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + type_: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + type_: type_.into(), + } + } + } + } + pub mod properties { + use super::super::models; + use super::super::properties::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets properties for a build."] + #[doc = ""] + #[doc = "See [`get_build_properties`](super::super::properties::Client::get_build_properties) for details of the arguments."] + pub fn get_build_properties( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> get_build_properties::RequestBuilder { + get_build_properties::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + filter: None, + } + } + #[doc = "Updates properties for a build."] + #[doc = ""] + #[doc = "See [`update_build_properties`](super::super::properties::Client::update_build_properties) for details of the arguments."] + pub fn update_build_properties( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + build_id: i32, + ) -> update_build_properties::RequestBuilder { + update_build_properties::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + build_id, + } + } + #[doc = "Gets properties for a definition."] + #[doc = ""] + #[doc = "See [`get_definition_properties`](super::super::properties::Client::get_definition_properties) for details of the arguments."] + pub fn get_definition_properties( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + ) -> get_definition_properties::RequestBuilder { + get_definition_properties::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + filter: None, + } + } + #[doc = "Updates properties for a definition."] + #[doc = ""] + #[doc = "See [`update_definition_properties`](super::super::properties::Client::update_definition_properties) for details of the arguments."] + pub fn update_definition_properties( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + definition_id: i32, + ) -> update_definition_properties::RequestBuilder { + update_definition_properties::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + definition_id, + } + } + } + } + pub mod report { + use super::super::models; + use super::super::report::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a build report."] + #[doc = ""] + #[doc = "See [`get`](super::super::report::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + type_: None, + } + } + } + } + pub mod stages { + use super::super::models; + use super::super::stages::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Update a build stage"] + #[doc = ""] + #[doc = "See [`update`](super::super::stages::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + build_id: i32, + stage_ref_name: impl Into, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + build_id, + stage_ref_name: stage_ref_name.into(), + project: project.into(), + } + } + } + } + pub mod tags { + use super::super::models; + use super::super::tags::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the tags for a build."] + #[doc = ""] + #[doc = "See [`get_build_tags`](super::super::tags::Client::get_build_tags) for details of the arguments."] + pub fn get_build_tags( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> get_build_tags::RequestBuilder { + get_build_tags::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + } + } + #[doc = "Adds tags to a build."] + #[doc = ""] + #[doc = "See [`add_build_tags`](super::super::tags::Client::add_build_tags) for details of the arguments."] + pub fn add_build_tags( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + build_id: i32, + ) -> add_build_tags::RequestBuilder { + add_build_tags::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + build_id, + } + } + #[doc = "Adds/Removes tags from a build."] + #[doc = ""] + #[doc = "See [`update_build_tags`](super::super::tags::Client::update_build_tags) for details of the arguments."] + pub fn update_build_tags( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + build_id: i32, + ) -> update_build_tags::RequestBuilder { + update_build_tags::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + build_id, + } + } + #[doc = "Adds a tag to a build."] + #[doc = ""] + #[doc = "See [`add_build_tag`](super::super::tags::Client::add_build_tag) for details of the arguments."] + pub fn add_build_tag( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + tag: impl Into, + ) -> add_build_tag::RequestBuilder { + add_build_tag::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + tag: tag.into(), + } + } + #[doc = "Removes a tag from a build. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+)"] + #[doc = ""] + #[doc = "See [`delete_build_tag`](super::super::tags::Client::delete_build_tag) for details of the arguments."] + pub fn delete_build_tag( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + tag: impl Into, + ) -> delete_build_tag::RequestBuilder { + delete_build_tag::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + tag: tag.into(), + } + } + #[doc = "Gets the tags for a definition."] + #[doc = ""] + #[doc = "See [`get_definition_tags`](super::super::tags::Client::get_definition_tags) for details of the arguments."] + pub fn get_definition_tags( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + ) -> get_definition_tags::RequestBuilder { + get_definition_tags::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + revision: None, + } + } + #[doc = "Adds multiple tags to a definition."] + #[doc = ""] + #[doc = "See [`add_definition_tags`](super::super::tags::Client::add_definition_tags) for details of the arguments."] + pub fn add_definition_tags( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + definition_id: i32, + ) -> add_definition_tags::RequestBuilder { + add_definition_tags::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + definition_id, + } + } + #[doc = "Adds/Removes tags from a definition."] + #[doc = ""] + #[doc = "See [`update_definition_tags`](super::super::tags::Client::update_definition_tags) for details of the arguments."] + pub fn update_definition_tags( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + definition_id: i32, + ) -> update_definition_tags::RequestBuilder { + update_definition_tags::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + definition_id, + } + } + #[doc = "Adds a tag to a definition"] + #[doc = ""] + #[doc = "See [`add_definition_tag`](super::super::tags::Client::add_definition_tag) for details of the arguments."] + pub fn add_definition_tag( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + tag: impl Into, + ) -> add_definition_tag::RequestBuilder { + add_definition_tag::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + tag: tag.into(), + } + } + #[doc = "Removes a tag from a definition. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+)"] + #[doc = ""] + #[doc = "See [`delete_definition_tag`](super::super::tags::Client::delete_definition_tag) for details of the arguments."] + pub fn delete_definition_tag( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + tag: impl Into, + ) -> delete_definition_tag::RequestBuilder { + delete_definition_tag::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + tag: tag.into(), + } + } + #[doc = "Gets a list of all build tags in the project."] + #[doc = ""] + #[doc = "See [`get_tags`](super::super::tags::Client::get_tags) for details of the arguments."] + pub fn get_tags( + &self, + organization: impl Into, + project: impl Into, + ) -> get_tags::RequestBuilder { + get_tags::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Removes a tag from builds, definitions, and from the tag store"] + #[doc = ""] + #[doc = "See [`delete_tag`](super::super::tags::Client::delete_tag) for details of the arguments."] + pub fn delete_tag( + &self, + organization: impl Into, + project: impl Into, + tag: impl Into, + ) -> delete_tag::RequestBuilder { + delete_tag::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + tag: tag.into(), + } + } + } + } + pub mod timeline { + use super::super::models; + use super::super::timeline::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets details for a build"] + #[doc = ""] + #[doc = "See [`get`](super::super::timeline::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + timeline_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + timeline_id: timeline_id.into(), + change_id: None, + plan_id: None, + } + } + } + } + pub mod definitions { + use super::super::definitions::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of definitions."] + #[doc = ""] + #[doc = "See [`list`](super::super::definitions::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + name: None, + repository_id: None, + repository_type: None, + query_order: None, + top: None, + continuation_token: None, + min_metrics_time: None, + definition_ids: None, + path: None, + built_after: None, + not_built_after: None, + include_all_properties: None, + include_latest_builds: None, + task_id_filter: None, + process_type: None, + yaml_filename: None, + } + } + #[doc = "Creates a new definition."] + #[doc = ""] + #[doc = "See [`create`](super::super::definitions::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + definition_to_clone_id: None, + definition_to_clone_revision: None, + } + } + #[doc = "Gets a definition, optionally at a specific revision."] + #[doc = ""] + #[doc = "See [`get`](super::super::definitions::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + revision: None, + min_metrics_time: None, + property_filters: None, + include_latest_builds: None, + } + } + #[doc = "Updates an existing build definition. In order for this operation to succeed, the value of the \"Revision\" property of the request body must match the existing build definition's. It is recommended that you obtain the existing build definition by using GET, modify the build definition as necessary, and then submit the modified definition with PUT."] + #[doc = ""] + #[doc = "See [`update`](super::super::definitions::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + definition_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + definition_id, + secrets_source_definition_id: None, + secrets_source_definition_revision: None, + } + } + #[doc = "Restores a deleted definition"] + #[doc = ""] + #[doc = "See [`restore_definition`](super::super::definitions::Client::restore_definition) for details of the arguments."] + pub fn restore_definition( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + deleted: bool, + ) -> restore_definition::RequestBuilder { + restore_definition::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + deleted, + } + } + #[doc = "Deletes a definition and all associated builds."] + #[doc = ""] + #[doc = "See [`delete`](super::super::definitions::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + } + } + #[doc = "Gets all revisions of a definition."] + #[doc = ""] + #[doc = "See [`get_definition_revisions`](super::super::definitions::Client::get_definition_revisions) for details of the arguments."] + pub fn get_definition_revisions( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + ) -> get_definition_revisions::RequestBuilder { + get_definition_revisions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + } + } + } + } + pub mod metrics { + use super::super::metrics::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets build metrics for a definition."] + #[doc = ""] + #[doc = "See [`get_definition_metrics`](super::super::metrics::Client::get_definition_metrics) for details of the arguments."] + pub fn get_definition_metrics( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + ) -> get_definition_metrics::RequestBuilder { + get_definition_metrics::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + min_metrics_time: None, + } + } + #[doc = "Gets build metrics for a project."] + #[doc = ""] + #[doc = "See [`get_project_metrics`](super::super::metrics::Client::get_project_metrics) for details of the arguments."] + pub fn get_project_metrics( + &self, + organization: impl Into, + project: impl Into, + metric_aggregation_type: impl Into, + ) -> get_project_metrics::RequestBuilder { + get_project_metrics::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + metric_aggregation_type: metric_aggregation_type.into(), + min_metrics_time: None, + } + } + } + } + pub mod resources { + use super::super::models; + use super::super::resources::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`list`](super::super::resources::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + } + } + #[doc = "See [`authorize_definition_resources`](super::super::resources::Client::authorize_definition_resources) for details of the arguments."] + pub fn authorize_definition_resources( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + definition_id: i32, + ) -> authorize_definition_resources::RequestBuilder { + authorize_definition_resources::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + definition_id, + } + } + } + } + pub mod yaml { + use super::super::models; + use super::super::yaml::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Converts a definition to YAML, optionally at a specific revision."] + #[doc = ""] + #[doc = "See [`get`](super::super::yaml::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + revision: None, + min_metrics_time: None, + property_filters: None, + include_latest_builds: None, + } + } + } + } + pub mod templates { + use super::super::models; + use super::super::templates::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all definition templates."] + #[doc = ""] + #[doc = "See [`list`](super::super::templates::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Gets a specific build definition template."] + #[doc = ""] + #[doc = "See [`get`](super::super::templates::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + template_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + template_id: template_id.into(), + } + } + #[doc = "Updates an existing build definition template."] + #[doc = ""] + #[doc = "See [`save_template`](super::super::templates::Client::save_template) for details of the arguments."] + pub fn save_template( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + template_id: impl Into, + ) -> save_template::RequestBuilder { + save_template::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + template_id: template_id.into(), + } + } + #[doc = "Deletes a build definition template."] + #[doc = ""] + #[doc = "See [`delete`](super::super::templates::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + template_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + template_id: template_id.into(), + } + } + } + } + pub mod folders { + use super::super::folders::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Updates an existing folder at given existing path"] + #[doc = ""] + #[doc = "See [`update`](super::super::folders::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + path: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + path: path.into(), + } + } + #[doc = "Creates a new folder."] + #[doc = ""] + #[doc = "See [`create`](super::super::folders::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + path: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + path: path.into(), + } + } + #[doc = "Deletes a definition folder. Definitions and their corresponding builds will also be deleted."] + #[doc = ""] + #[doc = "See [`delete`](super::super::folders::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + path: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + path: path.into(), + } + } + #[doc = "Gets a list of build definition folders."] + #[doc = ""] + #[doc = "See [`list`](super::super::folders::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + path: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + path: path.into(), + query_order: None, + } + } + } + } + pub mod general_settings { + use super::super::general_settings::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets pipeline general settings."] + #[doc = ""] + #[doc = "See [`get`](super::super::general_settings::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Updates pipeline general settings."] + #[doc = ""] + #[doc = "See [`update`](super::super::general_settings::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod latest { + use super::super::latest::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the latest build for a definition, optionally scoped to a specific branch."] + #[doc = ""] + #[doc = "See [`get`](super::super::latest::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + definition: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition: definition.into(), + branch_name: None, + } + } + } + } + pub mod options { + use super::super::models; + use super::super::options::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all build definition options supported by the system."] + #[doc = ""] + #[doc = "See [`list`](super::super::options::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + } + } + pub mod retention { + use super::super::models; + use super::super::retention::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the project's retention settings."] + #[doc = ""] + #[doc = "See [`get`](super::super::retention::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Updates the project's retention settings."] + #[doc = ""] + #[doc = "See [`update`](super::super::retention::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod settings { + use super::super::models; + use super::super::settings::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the build settings."] + #[doc = ""] + #[doc = "See [`get`](super::super::settings::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Updates the build settings."] + #[doc = ""] + #[doc = "See [`update`](super::super::settings::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod status { + use super::super::models; + use super::super::status::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "

Gets the build status for a definition, optionally scoped to a specific branch, stage, job, and configuration.

If there are more than one, then it is required to pass in a stageName value when specifying a jobName, and the same rule then applies for both if passing a configuration parameter.

"] + #[doc = ""] + #[doc = "See [`get`](super::super::status::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + definition: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition: definition.into(), + branch_name: None, + stage_name: None, + job_name: None, + configuration: None, + label: None, + } + } + } + } + pub mod source_providers { + use super::super::models; + use super::super::source_providers::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of source providers and their capabilities."] + #[doc = ""] + #[doc = "See [`list`](super::super::source_providers::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Gets a list of branches for the given source code repository."] + #[doc = ""] + #[doc = "See [`list_branches`](super::super::source_providers::Client::list_branches) for details of the arguments."] + pub fn list_branches( + &self, + organization: impl Into, + project: impl Into, + provider_name: impl Into, + ) -> list_branches::RequestBuilder { + list_branches::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + provider_name: provider_name.into(), + service_endpoint_id: None, + repository: None, + branch_name: None, + } + } + #[doc = "Gets the contents of a file in the given source code repository."] + #[doc = ""] + #[doc = "See [`get_file_contents`](super::super::source_providers::Client::get_file_contents) for details of the arguments."] + pub fn get_file_contents( + &self, + organization: impl Into, + project: impl Into, + provider_name: impl Into, + ) -> get_file_contents::RequestBuilder { + get_file_contents::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + provider_name: provider_name.into(), + service_endpoint_id: None, + repository: None, + commit_or_branch: None, + path: None, + } + } + #[doc = "Gets the contents of a directory in the given source code repository."] + #[doc = ""] + #[doc = "See [`get_path_contents`](super::super::source_providers::Client::get_path_contents) for details of the arguments."] + pub fn get_path_contents( + &self, + organization: impl Into, + project: impl Into, + provider_name: impl Into, + ) -> get_path_contents::RequestBuilder { + get_path_contents::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + provider_name: provider_name.into(), + service_endpoint_id: None, + repository: None, + commit_or_branch: None, + path: None, + } + } + #[doc = "Gets a pull request object from source provider."] + #[doc = ""] + #[doc = "See [`get_pull_request`](super::super::source_providers::Client::get_pull_request) for details of the arguments."] + pub fn get_pull_request( + &self, + organization: impl Into, + project: impl Into, + provider_name: impl Into, + pull_request_id: impl Into, + ) -> get_pull_request::RequestBuilder { + get_pull_request::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + provider_name: provider_name.into(), + pull_request_id: pull_request_id.into(), + repository_id: None, + service_endpoint_id: None, + } + } + #[doc = "Gets a list of source code repositories."] + #[doc = ""] + #[doc = "See [`list_repositories`](super::super::source_providers::Client::list_repositories) for details of the arguments."] + pub fn list_repositories( + &self, + organization: impl Into, + project: impl Into, + provider_name: impl Into, + ) -> list_repositories::RequestBuilder { + list_repositories::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + provider_name: provider_name.into(), + service_endpoint_id: None, + repository: None, + result_set: None, + page_results: None, + continuation_token: None, + } + } + #[doc = "Gets a list of webhooks installed in the given source code repository."] + #[doc = ""] + #[doc = "See [`list_webhooks`](super::super::source_providers::Client::list_webhooks) for details of the arguments."] + pub fn list_webhooks( + &self, + organization: impl Into, + project: impl Into, + provider_name: impl Into, + ) -> list_webhooks::RequestBuilder { + list_webhooks::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + provider_name: provider_name.into(), + service_endpoint_id: None, + repository: None, + } + } + #[doc = "Recreates the webhooks for the specified triggers in the given source code repository."] + #[doc = ""] + #[doc = "See [`restore_webhooks`](super::super::source_providers::Client::restore_webhooks) for details of the arguments."] + pub fn restore_webhooks( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + provider_name: impl Into, + ) -> restore_webhooks::RequestBuilder { + restore_webhooks::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + provider_name: provider_name.into(), + service_endpoint_id: None, + repository: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/core/mod.rs b/azure_devops_rust_api/src/core/mod.rs index efd48bf6..8bea68b2 100644 --- a/azure_devops_rust_api/src/core/mod.rs +++ b/azure_devops_rust_api/src/core/mod.rs @@ -215,10 +215,41 @@ pub mod processes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -228,9 +259,7 @@ pub mod processes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -242,24 +271,24 @@ pub mod processes { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -309,11 +338,43 @@ pub mod processes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/process/processes/{}", + self.client.endpoint(), + self.organization, + self.process_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -323,9 +384,7 @@ pub mod processes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -337,25 +396,24 @@ pub mod processes { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/process/processes/{}", - self.client.endpoint(), - self.organization, - self.process_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -537,8 +595,12 @@ pub mod projects { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) state_filter: Option, pub(crate) top: Option, @@ -546,7 +608,7 @@ pub mod projects { pub(crate) continuation_token: Option, pub(crate) get_default_team_image_url: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Filter on team projects in a specific team project state (default: WellFormed)."] pub fn state_filter(mut self, state_filter: impl Into) -> Self { self.state_filter = Some(state_filter.into()); @@ -569,6 +631,60 @@ pub mod projects { self.get_default_team_image_url = Some(get_default_team_image_url); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(state_filter) = &this.state_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("stateFilter", &state_filter.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", &continuation_token.to_string()); + } + if let Some(get_default_team_image_url) = &this.get_default_team_image_url { + req.url_mut().query_pairs_mut().append_pair( + "getDefaultTeamImageUrl", + &get_default_team_image_url.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -577,9 +693,7 @@ pub mod projects { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -591,50 +705,24 @@ pub mod projects { auth_header, ); } - if let Some(state_filter) = &this.state_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("stateFilter", &state_filter.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", &continuation_token.to_string()); - } - if let Some(get_default_team_image_url) = &this.get_default_team_image_url { - req.url_mut().query_pairs_mut().append_pair( - "getDefaultTeamImageUrl", - &get_default_team_image_url.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -685,11 +773,43 @@ pub mod projects { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TeamProject, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -699,9 +819,7 @@ pub mod projects { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -713,25 +831,24 @@ pub mod projects { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -781,14 +898,18 @@ pub mod projects { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project_id: String, pub(crate) include_capabilities: Option, pub(crate) include_history: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Include capabilities (such as source control) in the team project result (default: false)."] pub fn include_capabilities(mut self, include_capabilities: bool) -> Self { self.include_capabilities = Some(include_capabilities); @@ -799,6 +920,45 @@ pub mod projects { self.include_history = Some(include_history); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_capabilities) = &this.include_capabilities { + req.url_mut() + .query_pairs_mut() + .append_pair("includeCapabilities", &include_capabilities.to_string()); + } + if let Some(include_history) = &this.include_history { + req.url_mut() + .query_pairs_mut() + .append_pair("includeHistory", &include_history.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}", + self.client.endpoint(), + self.organization, + self.project_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -807,9 +967,7 @@ pub mod projects { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -821,36 +979,24 @@ pub mod projects { auth_header, ); } - if let Some(include_capabilities) = &this.include_capabilities { - req.url_mut().query_pairs_mut().append_pair( - "includeCapabilities", - &include_capabilities.to_string(), - ); - } - if let Some(include_history) = &this.include_history { - req.url_mut() - .query_pairs_mut() - .append_pair("includeHistory", &include_history.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}", - self.client.endpoint(), - self.organization, - self.project_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -900,12 +1046,45 @@ pub mod projects { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TeamProject, pub(crate) project_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}", + self.client.endpoint(), + self.organization, + self.project_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -915,9 +1094,7 @@ pub mod projects { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -929,26 +1106,24 @@ pub mod projects { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}", - self.client.endpoint(), - self.organization, - self.project_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -998,11 +1173,43 @@ pub mod projects { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}", + self.client.endpoint(), + self.organization, + self.project_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1012,9 +1219,7 @@ pub mod projects { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1026,25 +1231,24 @@ pub mod projects { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}", - self.client.endpoint(), - self.organization, - self.project_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1094,18 +1298,54 @@ pub mod projects { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project_id: String, pub(crate) keys: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A comma-delimited string of team project property names. Wildcard characters (\"?\" and \"*\") are supported. If no key is specified, all properties will be returned."] pub fn keys(mut self, keys: impl Into) -> Self { self.keys = Some(keys.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(keys) = &this.keys { + req.url_mut().query_pairs_mut().append_pair("keys", keys); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}/properties", + self.client.endpoint(), + self.organization, + self.project_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1114,9 +1354,7 @@ pub mod projects { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1128,28 +1366,24 @@ pub mod projects { auth_header, ); } - if let Some(keys) = &this.keys { - req.url_mut().query_pairs_mut().append_pair("keys", keys); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}/properties", - self.client.endpoint(), - self.organization, - self.project_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1194,12 +1428,45 @@ pub mod projects { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project_id: String, pub(crate) body: models::JsonPatchDocument, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}/properties", + self.client.endpoint(), + self.organization, + self.project_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1209,9 +1476,7 @@ pub mod projects { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1223,26 +1488,24 @@ pub mod projects { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}/properties", - self.client.endpoint(), - self.organization, - self.project_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1335,12 +1598,45 @@ pub mod avatar { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ProjectAvatar, pub(crate) project_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}/avatar", + self.client.endpoint(), + self.organization, + self.project_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1350,9 +1646,7 @@ pub mod avatar { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1364,26 +1658,24 @@ pub mod avatar { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}/avatar", - self.client.endpoint(), - self.organization, - self.project_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1431,11 +1723,43 @@ pub mod avatar { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}/avatar", + self.client.endpoint(), + self.organization, + self.project_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1445,9 +1769,7 @@ pub mod avatar { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1459,25 +1781,24 @@ pub mod avatar { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}/avatar", - self.client.endpoint(), - self.organization, - self.project_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1562,15 +1883,19 @@ pub mod categorized_teams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project_id: String, pub(crate) expand_identity: Option, pub(crate) top: Option, pub(crate) skip: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A value indicating whether or not to expand Identity information in the result WebApiTeam object."] pub fn expand_identity(mut self, expand_identity: bool) -> Self { self.expand_identity = Some(expand_identity); @@ -1586,6 +1911,50 @@ pub mod categorized_teams { self.skip = Some(skip); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand_identity) = &this.expand_identity { + req.url_mut() + .query_pairs_mut() + .append_pair("$expandIdentity", &expand_identity.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}/categorizedteams/", + self.client.endpoint(), + self.organization, + self.project_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1594,9 +1963,7 @@ pub mod categorized_teams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1608,40 +1975,24 @@ pub mod categorized_teams { auth_header, ); } - if let Some(expand_identity) = &this.expand_identity { - req.url_mut() - .query_pairs_mut() - .append_pair("$expandIdentity", &expand_identity.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}/categorizedteams/", - self.client.endpoint(), - self.organization, - self.project_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1838,8 +2189,12 @@ pub mod teams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project_id: String, pub(crate) mine: Option, @@ -1847,7 +2202,7 @@ pub mod teams { pub(crate) skip: Option, pub(crate) expand_identity: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If true return all the teams requesting user is member, otherwise return all the teams user has read access."] pub fn mine(mut self, mine: bool) -> Self { self.mine = Some(mine); @@ -1868,6 +2223,55 @@ pub mod teams { self.expand_identity = Some(expand_identity); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(mine) = &this.mine { + req.url_mut() + .query_pairs_mut() + .append_pair("$mine", &mine.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}/teams", + self.client.endpoint(), + self.organization, + self.project_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1876,9 +2280,7 @@ pub mod teams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1890,45 +2292,24 @@ pub mod teams { auth_header, ); } - if let Some(mine) = &this.mine { - req.url_mut() - .query_pairs_mut() - .append_pair("$mine", &mine.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}/teams", - self.client.endpoint(), - self.organization, - self.project_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1978,12 +2359,45 @@ pub mod teams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WebApiTeam, pub(crate) project_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}/teams", + self.client.endpoint(), + self.organization, + self.project_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1993,9 +2407,7 @@ pub mod teams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2007,26 +2419,24 @@ pub mod teams { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}/teams", - self.client.endpoint(), - self.organization, - self.project_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2076,19 +2486,58 @@ pub mod teams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project_id: String, pub(crate) team_id: String, pub(crate) expand_identity: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A value indicating whether or not to expand Identity information in the result WebApiTeam object."] pub fn expand_identity(mut self, expand_identity: bool) -> Self { self.expand_identity = Some(expand_identity); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}/teams/{}", + self.client.endpoint(), + self.organization, + self.project_id, + self.team_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2097,9 +2546,7 @@ pub mod teams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2111,31 +2558,24 @@ pub mod teams { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}/teams/{}", - self.client.endpoint(), - self.organization, - self.project_id, - self.team_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2185,13 +2625,47 @@ pub mod teams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WebApiTeam, pub(crate) project_id: String, pub(crate) team_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}/teams/{}", + self.client.endpoint(), + self.organization, + self.project_id, + self.team_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2201,9 +2675,7 @@ pub mod teams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2215,27 +2687,24 @@ pub mod teams { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}/teams/{}", - self.client.endpoint(), - self.organization, - self.project_id, - self.team_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2280,12 +2749,45 @@ pub mod teams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project_id: String, pub(crate) team_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}/teams/{}", + self.client.endpoint(), + self.organization, + self.project_id, + self.team_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2295,9 +2797,7 @@ pub mod teams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2309,26 +2809,24 @@ pub mod teams { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}/teams/{}", - self.client.endpoint(), - self.organization, - self.project_id, - self.team_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2381,15 +2879,19 @@ pub mod teams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project_id: String, pub(crate) team_id: String, pub(crate) top: Option, pub(crate) skip: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn top(mut self, top: i32) -> Self { self.top = Some(top); self @@ -2398,6 +2900,46 @@ pub mod teams { self.skip = Some(skip); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/projects/{}/teams/{}/members", + self.client.endpoint(), + self.organization, + self.project_id, + self.team_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2406,9 +2948,7 @@ pub mod teams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2420,36 +2960,24 @@ pub mod teams { auth_header, ); } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/projects/{}/teams/{}/members", - self.client.endpoint(), - self.organization, - self.project_id, - self.team_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2499,15 +3027,19 @@ pub mod teams { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) mine: Option, pub(crate) top: Option, pub(crate) skip: Option, pub(crate) expand_identity: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If true, then return all teams requesting user is member. Otherwise return all teams user has read access."] pub fn mine(mut self, mine: bool) -> Self { self.mine = Some(mine); @@ -2528,6 +3060,54 @@ pub mod teams { self.expand_identity = Some(expand_identity); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(mine) = &this.mine { + req.url_mut() + .query_pairs_mut() + .append_pair("$mine", &mine.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2536,9 +3116,7 @@ pub mod teams { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2550,44 +3128,24 @@ pub mod teams { auth_header, ); } - if let Some(mine) = &this.mine { - req.url_mut() - .query_pairs_mut() - .append_pair("$mine", &mine.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2604,3 +3162,433 @@ pub mod teams { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn avatar_client(&self) -> avatar::Client { + avatar::Client(self.clone()) + } + pub fn categorized_teams_client(&self) -> categorized_teams::Client { + categorized_teams::Client(self.clone()) + } + pub fn processes_client(&self) -> processes::Client { + processes::Client(self.clone()) + } + pub fn projects_client(&self) -> projects::Client { + projects::Client(self.clone()) + } + pub fn teams_client(&self) -> teams::Client { + teams::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod processes { + use super::super::models; + use super::super::processes::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of processes."] + #[doc = ""] + #[doc = "See [`list`](super::super::processes::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Get a process by ID."] + #[doc = ""] + #[doc = "See [`get`](super::super::processes::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + process_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + } + } + } + } + pub mod projects { + use super::super::models; + use super::super::projects::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all projects in the organization that the authenticated user has access to."] + #[doc = ""] + #[doc = "See [`list`](super::super::projects::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + state_filter: None, + top: None, + skip: None, + continuation_token: None, + get_default_team_image_url: None, + } + } + #[doc = "Queues a project to be created. Use the [GetOperation](../../operations/operations/get) to periodically check for create project status."] + #[doc = ""] + #[doc = "See [`create`](super::super::projects::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Get project with the specified id or name, optionally including capabilities."] + #[doc = ""] + #[doc = "See [`get`](super::super::projects::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project_id: project_id.into(), + include_capabilities: None, + include_history: None, + } + } + #[doc = "Update an existing project's name, abbreviation, description, or restore a project."] + #[doc = ""] + #[doc = "See [`update`](super::super::projects::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project_id: project_id.into(), + } + } + #[doc = "Queues a project to be deleted. Use the [GetOperation](../../operations/operations/get) to periodically check for delete project status."] + #[doc = ""] + #[doc = "See [`delete`](super::super::projects::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project_id: project_id.into(), + } + } + #[doc = "Get a collection of team project properties."] + #[doc = ""] + #[doc = "See [`get_project_properties`](super::super::projects::Client::get_project_properties) for details of the arguments."] + pub fn get_project_properties( + &self, + organization: impl Into, + project_id: impl Into, + ) -> get_project_properties::RequestBuilder { + get_project_properties::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project_id: project_id.into(), + keys: None, + } + } + #[doc = "Create, update, and delete team project properties."] + #[doc = ""] + #[doc = "See [`set_project_properties`](super::super::projects::Client::set_project_properties) for details of the arguments."] + pub fn set_project_properties( + &self, + organization: impl Into, + project_id: impl Into, + body: impl Into, + ) -> set_project_properties::RequestBuilder { + set_project_properties::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project_id: project_id.into(), + body: body.into(), + } + } + } + } + pub mod avatar { + use super::super::avatar::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Sets the avatar for the project."] + #[doc = ""] + #[doc = "See [`set_project_avatar`](super::super::avatar::Client::set_project_avatar) for details of the arguments."] + pub fn set_project_avatar( + &self, + organization: impl Into, + body: impl Into, + project_id: impl Into, + ) -> set_project_avatar::RequestBuilder { + set_project_avatar::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project_id: project_id.into(), + } + } + #[doc = "Removes the avatar for the project."] + #[doc = ""] + #[doc = "See [`remove_project_avatar`](super::super::avatar::Client::remove_project_avatar) for details of the arguments."] + pub fn remove_project_avatar( + &self, + organization: impl Into, + project_id: impl Into, + ) -> remove_project_avatar::RequestBuilder { + remove_project_avatar::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project_id: project_id.into(), + } + } + } + } + pub mod categorized_teams { + use super::super::categorized_teams::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets list of user readable teams in a project and teams user is member of (excluded from readable list)."] + #[doc = ""] + #[doc = "See [`get`](super::super::categorized_teams::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project_id: project_id.into(), + expand_identity: None, + top: None, + skip: None, + } + } + } + } + pub mod teams { + use super::super::models; + use super::super::teams::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of teams."] + #[doc = ""] + #[doc = "See [`get_teams`](super::super::teams::Client::get_teams) for details of the arguments."] + pub fn get_teams( + &self, + organization: impl Into, + project_id: impl Into, + ) -> get_teams::RequestBuilder { + get_teams::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project_id: project_id.into(), + mine: None, + top: None, + skip: None, + expand_identity: None, + } + } + #[doc = "Create a team in a team project.\n\nPossible failure scenarios\nInvalid project name/ID (project doesn't exist) 404\nInvalid team name or description 400\nTeam already exists 400\nInsufficient privileges 400"] + #[doc = ""] + #[doc = "See [`create`](super::super::teams::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project_id: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project_id: project_id.into(), + } + } + #[doc = "Get a specific team."] + #[doc = ""] + #[doc = "See [`get`](super::super::teams::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project_id: impl Into, + team_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project_id: project_id.into(), + team_id: team_id.into(), + expand_identity: None, + } + } + #[doc = "Update a team's name and/or description."] + #[doc = ""] + #[doc = "See [`update`](super::super::teams::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project_id: impl Into, + team_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project_id: project_id.into(), + team_id: team_id.into(), + } + } + #[doc = "Delete a team."] + #[doc = ""] + #[doc = "See [`delete`](super::super::teams::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project_id: impl Into, + team_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project_id: project_id.into(), + team_id: team_id.into(), + } + } + #[doc = "Get a list of members for a specific team."] + #[doc = ""] + #[doc = "See [`get_team_members_with_extended_properties`](super::super::teams::Client::get_team_members_with_extended_properties) for details of the arguments."] + pub fn get_team_members_with_extended_properties( + &self, + organization: impl Into, + project_id: impl Into, + team_id: impl Into, + ) -> get_team_members_with_extended_properties::RequestBuilder + { + get_team_members_with_extended_properties::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project_id: project_id.into(), + team_id: team_id.into(), + top: None, + skip: None, + } + } + #[doc = "Get a list of all teams."] + #[doc = ""] + #[doc = "See [`get_all_teams`](super::super::teams::Client::get_all_teams) for details of the arguments."] + pub fn get_all_teams( + &self, + organization: impl Into, + ) -> get_all_teams::RequestBuilder { + get_all_teams::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + mine: None, + top: None, + skip: None, + expand_identity: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/dashboard/mod.rs b/azure_devops_rust_api/src/dashboard/mod.rs index ce263746..d656f784 100644 --- a/azure_devops_rust_api/src/dashboard/mod.rs +++ b/azure_devops_rust_api/src/dashboard/mod.rs @@ -220,12 +220,48 @@ pub mod widget_types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) scope: models::WidgetScope, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let scope = &this.scope; + req.url_mut() + .query_pairs_mut() + .append_pair("$scope", &scope.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/dashboard/widgettypes", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -235,9 +271,7 @@ pub mod widget_types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -249,29 +283,24 @@ pub mod widget_types { auth_header, ); } - let scope = &this.scope; - req.url_mut() - .query_pairs_mut() - .append_pair("$scope", &scope.to_string()); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/dashboard/widgettypes", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -324,12 +353,45 @@ pub mod widget_types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) contribution_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/dashboard/widgettypes/{}", + self.client.endpoint(), + self.organization, + self.project, + self.contribution_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -339,9 +401,7 @@ pub mod widget_types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -353,26 +413,24 @@ pub mod widget_types { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/dashboard/widgettypes/{}", - self.client.endpoint(), - self.organization, - self.project, - self.contribution_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -563,12 +621,45 @@ pub mod dashboards { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -578,9 +669,7 @@ pub mod dashboards { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -592,26 +681,24 @@ pub mod dashboards { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -661,13 +748,47 @@ pub mod dashboards { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Dashboard, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -677,9 +798,7 @@ pub mod dashboards { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -691,27 +810,24 @@ pub mod dashboards { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -761,13 +877,47 @@ pub mod dashboards { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::DashboardGroup, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -777,9 +927,7 @@ pub mod dashboards { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -791,27 +939,24 @@ pub mod dashboards { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -861,13 +1006,47 @@ pub mod dashboards { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) dashboard_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.dashboard_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -877,9 +1056,7 @@ pub mod dashboards { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -891,27 +1068,24 @@ pub mod dashboards { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.dashboard_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -961,14 +1135,49 @@ pub mod dashboards { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Dashboard, pub(crate) project: String, pub(crate) dashboard_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.dashboard_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -978,9 +1187,7 @@ pub mod dashboards { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -992,28 +1199,24 @@ pub mod dashboards { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.dashboard_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1058,13 +1261,47 @@ pub mod dashboards { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) dashboard_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.dashboard_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1074,9 +1311,7 @@ pub mod dashboards { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1088,27 +1323,24 @@ pub mod dashboards { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.dashboard_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1387,20 +1619,58 @@ pub mod widgets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) dashboard_id: String, pub(crate) team: String, pub(crate) e_tag: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Dashboard Widgets Version"] pub fn e_tag(mut self, e_tag: impl Into) -> Self { self.e_tag = Some(e_tag.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(e_tag) = &this.e_tag { + req.insert_header("etag", e_tag); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.dashboard_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1409,9 +1679,7 @@ pub mod widgets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1423,30 +1691,24 @@ pub mod widgets { auth_header, ); } - if let Some(e_tag) = &this.e_tag { - req.insert_header("etag", e_tag); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.dashboard_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1496,14 +1758,49 @@ pub mod widgets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Widget, pub(crate) project: String, pub(crate) dashboard_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.dashboard_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1513,9 +1810,7 @@ pub mod widgets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1527,28 +1822,24 @@ pub mod widgets { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.dashboard_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1608,8 +1899,12 @@ pub mod widgets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, @@ -1617,12 +1912,47 @@ pub mod widgets { pub(crate) team: String, pub(crate) e_tag: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Dashboard Widgets Version"] pub fn e_tag(mut self, e_tag: impl Into) -> Self { self.e_tag = Some(e_tag.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.dashboard_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1631,9 +1961,7 @@ pub mod widgets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1645,31 +1973,24 @@ pub mod widgets { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.dashboard_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1729,8 +2050,12 @@ pub mod widgets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, @@ -1738,12 +2063,47 @@ pub mod widgets { pub(crate) team: String, pub(crate) e_tag: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Dashboard Widgets Version"] pub fn e_tag(mut self, e_tag: impl Into) -> Self { self.e_tag = Some(e_tag.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.dashboard_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1752,9 +2112,7 @@ pub mod widgets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1766,31 +2124,24 @@ pub mod widgets { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.dashboard_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1840,14 +2191,49 @@ pub mod widgets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) dashboard_id: String, pub(crate) widget_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.dashboard_id, + self.widget_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1857,9 +2243,7 @@ pub mod widgets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1871,28 +2255,24 @@ pub mod widgets { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.dashboard_id, - self.widget_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1942,8 +2322,12 @@ pub mod widgets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Widget, pub(crate) project: String, @@ -1951,6 +2335,38 @@ pub mod widgets { pub(crate) widget_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.dashboard_id, + self.widget_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1960,9 +2376,7 @@ pub mod widgets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1974,29 +2388,24 @@ pub mod widgets { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.dashboard_id, - self.widget_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2046,8 +2455,12 @@ pub mod widgets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Widget, pub(crate) project: String, @@ -2055,6 +2468,38 @@ pub mod widgets { pub(crate) widget_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.dashboard_id, + self.widget_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2064,9 +2509,7 @@ pub mod widgets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2078,29 +2521,24 @@ pub mod widgets { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.dashboard_id, - self.widget_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2150,14 +2588,49 @@ pub mod widgets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) dashboard_id: String, pub(crate) widget_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.dashboard_id, + self.widget_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2167,9 +2640,7 @@ pub mod widgets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2181,28 +2652,24 @@ pub mod widgets { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/dashboard/dashboards/{}/widgets/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.dashboard_id, - self.widget_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2219,3 +2686,417 @@ pub mod widgets { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn dashboards_client(&self) -> dashboards::Client { + dashboards::Client(self.clone()) + } + pub fn widget_types_client(&self) -> widget_types::Client { + widget_types::Client(self.clone()) + } + pub fn widgets_client(&self) -> widgets::Client { + widgets::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod widget_types { + use super::super::models; + use super::super::widget_types::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all available widget metadata in alphabetical order, including widgets marked with isVisibleFromCatalog == false."] + #[doc = ""] + #[doc = "See [`get_widget_types`](super::super::widget_types::Client::get_widget_types) for details of the arguments."] + pub fn get_widget_types( + &self, + organization: impl Into, + scope: impl Into, + project: impl Into, + ) -> get_widget_types::RequestBuilder { + get_widget_types::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + scope: scope.into(), + project: project.into(), + } + } + #[doc = "Get the widget metadata satisfying the specified contribution ID."] + #[doc = ""] + #[doc = "See [`get_widget_metadata`](super::super::widget_types::Client::get_widget_metadata) for details of the arguments."] + pub fn get_widget_metadata( + &self, + organization: impl Into, + contribution_id: impl Into, + project: impl Into, + ) -> get_widget_metadata::RequestBuilder { + get_widget_metadata::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + contribution_id: contribution_id.into(), + project: project.into(), + } + } + } + } + pub mod dashboards { + use super::super::dashboards::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of dashboards under a project."] + #[doc = ""] + #[doc = "See [`list`](super::super::dashboards::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "Create the supplied dashboard."] + #[doc = ""] + #[doc = "See [`create`](super::super::dashboards::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "Update the name and position of dashboards in the supplied group, and remove omitted dashboards. Does not modify dashboard content."] + #[doc = ""] + #[doc = "See [`replace_dashboards`](super::super::dashboards::Client::replace_dashboards) for details of the arguments."] + pub fn replace_dashboards( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + ) -> replace_dashboards::RequestBuilder { + replace_dashboards::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "Get a dashboard by its ID."] + #[doc = ""] + #[doc = "See [`get`](super::super::dashboards::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + dashboard_id: impl Into, + team: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + dashboard_id: dashboard_id.into(), + team: team.into(), + } + } + #[doc = "Replace configuration for the specified dashboard. Replaces Widget list on Dashboard, only if property is supplied."] + #[doc = ""] + #[doc = "See [`replace_dashboard`](super::super::dashboards::Client::replace_dashboard) for details of the arguments."] + pub fn replace_dashboard( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + dashboard_id: impl Into, + team: impl Into, + ) -> replace_dashboard::RequestBuilder { + replace_dashboard::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + dashboard_id: dashboard_id.into(), + team: team.into(), + } + } + #[doc = "Delete a dashboard given its ID. This also deletes the widgets associated with this dashboard."] + #[doc = ""] + #[doc = "See [`delete`](super::super::dashboards::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + dashboard_id: impl Into, + team: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + dashboard_id: dashboard_id.into(), + team: team.into(), + } + } + } + } + pub mod widgets { + use super::super::models; + use super::super::widgets::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get widgets contained on the specified dashboard."] + #[doc = ""] + #[doc = "See [`get_widgets`](super::super::widgets::Client::get_widgets) for details of the arguments."] + pub fn get_widgets( + &self, + organization: impl Into, + project: impl Into, + dashboard_id: impl Into, + team: impl Into, + ) -> get_widgets::RequestBuilder { + get_widgets::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + dashboard_id: dashboard_id.into(), + team: team.into(), + e_tag: None, + } + } + #[doc = "Create a widget on the specified dashboard."] + #[doc = ""] + #[doc = "See [`create`](super::super::widgets::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + dashboard_id: impl Into, + team: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + dashboard_id: dashboard_id.into(), + team: team.into(), + } + } + #[doc = "Replace the widgets on specified dashboard with the supplied widgets."] + #[doc = ""] + #[doc = "See [`replace_widgets`](super::super::widgets::Client::replace_widgets) for details of the arguments."] + pub fn replace_widgets( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + dashboard_id: impl Into, + team: impl Into, + ) -> replace_widgets::RequestBuilder { + replace_widgets::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + dashboard_id: dashboard_id.into(), + team: team.into(), + e_tag: None, + } + } + #[doc = "Update the supplied widgets on the dashboard using supplied state. State of existing Widgets not passed in the widget list is preserved."] + #[doc = ""] + #[doc = "See [`update_widgets`](super::super::widgets::Client::update_widgets) for details of the arguments."] + pub fn update_widgets( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + dashboard_id: impl Into, + team: impl Into, + ) -> update_widgets::RequestBuilder { + update_widgets::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + dashboard_id: dashboard_id.into(), + team: team.into(), + e_tag: None, + } + } + #[doc = "Get the current state of the specified widget."] + #[doc = ""] + #[doc = "See [`get_widget`](super::super::widgets::Client::get_widget) for details of the arguments."] + pub fn get_widget( + &self, + organization: impl Into, + project: impl Into, + dashboard_id: impl Into, + widget_id: impl Into, + team: impl Into, + ) -> get_widget::RequestBuilder { + get_widget::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + dashboard_id: dashboard_id.into(), + widget_id: widget_id.into(), + team: team.into(), + } + } + #[doc = "Override the state of the specified widget."] + #[doc = ""] + #[doc = "See [`replace_widget`](super::super::widgets::Client::replace_widget) for details of the arguments."] + pub fn replace_widget( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + dashboard_id: impl Into, + widget_id: impl Into, + team: impl Into, + ) -> replace_widget::RequestBuilder { + replace_widget::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + dashboard_id: dashboard_id.into(), + widget_id: widget_id.into(), + team: team.into(), + } + } + #[doc = "Perform a partial update of the specified widget."] + #[doc = ""] + #[doc = "See [`update_widget`](super::super::widgets::Client::update_widget) for details of the arguments."] + pub fn update_widget( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + dashboard_id: impl Into, + widget_id: impl Into, + team: impl Into, + ) -> update_widget::RequestBuilder { + update_widget::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + dashboard_id: dashboard_id.into(), + widget_id: widget_id.into(), + team: team.into(), + } + } + #[doc = "Delete the specified widget."] + #[doc = ""] + #[doc = "See [`delete`](super::super::widgets::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + dashboard_id: impl Into, + widget_id: impl Into, + team: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + dashboard_id: dashboard_id.into(), + widget_id: widget_id.into(), + team: team.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/distributed_task/mod.rs b/azure_devops_rust_api/src/distributed_task/mod.rs index 9e9dac7c..a8facf9b 100644 --- a/azure_devops_rust_api/src/distributed_task/mod.rs +++ b/azure_devops_rust_api/src/distributed_task/mod.rs @@ -257,14 +257,49 @@ pub mod events { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::JobEvent, pub(crate) scope_identifier: String, pub(crate) hub_name: String, pub(crate) plan_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/events", + self.client.endpoint(), + self.organization, + self.scope_identifier, + self.hub_name, + self.plan_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -274,9 +309,7 @@ pub mod events { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -288,28 +321,24 @@ pub mod events { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/events", - self.client.endpoint(), - self.organization, - self.scope_identifier, - self.hub_name, - self.plan_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -396,8 +425,12 @@ pub mod oidctoken { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: serde_json::Value, pub(crate) scope_identifier: String, @@ -406,7 +439,7 @@ pub mod oidctoken { pub(crate) job_id: String, pub(crate) service_connection_id: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn service_connection_id( mut self, service_connection_id: impl Into, @@ -414,6 +447,44 @@ pub mod oidctoken { self.service_connection_id = Some(service_connection_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/jobs/{}/oidctoken", + self.client.endpoint(), + self.organization, + self.scope_identifier, + self.hub_name, + self.plan_id, + self.job_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -422,9 +493,7 @@ pub mod oidctoken { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -436,34 +505,24 @@ pub mod oidctoken { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/jobs/{}/oidctoken", - self.client.endpoint(), - self.organization, - self.scope_identifier, - self.hub_name, - self.plan_id, - self.job_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -576,14 +635,49 @@ pub mod logs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TaskLog, pub(crate) scope_identifier: String, pub(crate) hub_name: String, pub(crate) plan_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/logs", + self.client.endpoint(), + self.organization, + self.scope_identifier, + self.hub_name, + self.plan_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -593,9 +687,7 @@ pub mod logs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -607,28 +699,24 @@ pub mod logs { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/logs", - self.client.endpoint(), - self.organization, - self.scope_identifier, - self.hub_name, - self.plan_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -678,8 +766,12 @@ pub mod logs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: String, pub(crate) scope_identifier: String, @@ -687,6 +779,38 @@ pub mod logs { pub(crate) plan_id: String, pub(crate) log_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/octet-stream"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/logs/{}", + self.client.endpoint(), + self.organization, + self.scope_identifier, + self.hub_name, + self.plan_id, + self.log_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -696,9 +820,7 @@ pub mod logs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -710,29 +832,24 @@ pub mod logs { auth_header, ); } - req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/logs/{}", - self.client.endpoint(), - self.organization, - self.scope_identifier, - self.hub_name, - self.plan_id, - self.log_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -820,8 +937,12 @@ pub mod records { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::VssJsonCollectionWrapper, pub(crate) scope_identifier: String, @@ -829,6 +950,38 @@ pub mod records { pub(crate) plan_id: String, pub(crate) timeline_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/timelines/{}/records", + self.client.endpoint(), + self.organization, + self.scope_identifier, + self.hub_name, + self.plan_id, + self.timeline_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -838,9 +991,7 @@ pub mod records { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -852,29 +1003,24 @@ pub mod records { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/timelines/{}/records", - self.client.endpoint(), - self.organization, - self.scope_identifier, - self.hub_name, - self.plan_id, - self.timeline_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1033,15 +1179,19 @@ pub mod pools { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) pool_name: Option, pub(crate) properties: Option, pub(crate) pool_type: Option, pub(crate) action_filter: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Filter by name"] pub fn pool_name(mut self, pool_name: impl Into) -> Self { self.pool_name = Some(pool_name.into()); @@ -1065,6 +1215,54 @@ pub mod pools { self.action_filter = Some(action_filter.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(pool_name) = &this.pool_name { + req.url_mut() + .query_pairs_mut() + .append_pair("poolName", pool_name); + } + if let Some(properties) = &this.properties { + req.url_mut() + .query_pairs_mut() + .append_pair("properties", properties); + } + if let Some(pool_type) = &this.pool_type { + req.url_mut() + .query_pairs_mut() + .append_pair("poolType", &pool_type.to_string()); + } + if let Some(action_filter) = &this.action_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("actionFilter", &action_filter.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1073,9 +1271,7 @@ pub mod pools { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1087,44 +1283,24 @@ pub mod pools { auth_header, ); } - if let Some(pool_name) = &this.pool_name { - req.url_mut() - .query_pairs_mut() - .append_pair("poolName", pool_name); - } - if let Some(properties) = &this.properties { - req.url_mut() - .query_pairs_mut() - .append_pair("properties", properties); - } - if let Some(pool_type) = &this.pool_type { - req.url_mut() - .query_pairs_mut() - .append_pair("poolType", &pool_type.to_string()); - } - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", &action_filter.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1174,13 +1350,17 @@ pub mod pools { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) pool_ids: String, pub(crate) action_filter: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Filter by whether the calling user has use or manage permissions"] pub fn action_filter( mut self, @@ -1189,6 +1369,43 @@ pub mod pools { self.action_filter = Some(action_filter.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let pool_ids = &this.pool_ids; + req.url_mut() + .query_pairs_mut() + .append_pair("poolIds", pool_ids); + if let Some(action_filter) = &this.action_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("actionFilter", &action_filter.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1197,9 +1414,7 @@ pub mod pools { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1211,33 +1426,24 @@ pub mod pools { auth_header, ); } - let pool_ids = &this.pool_ids; - req.url_mut() - .query_pairs_mut() - .append_pair("poolIds", pool_ids); - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", &action_filter.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1287,11 +1493,43 @@ pub mod pools { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TaskAgentPool, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1301,9 +1539,7 @@ pub mod pools { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1315,25 +1551,24 @@ pub mod pools { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1383,14 +1618,18 @@ pub mod pools { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) pool_id: i32, pub(crate) properties: Option, pub(crate) action_filter: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Agent pool properties (comma-separated)"] pub fn properties(mut self, properties: impl Into) -> Self { self.properties = Some(properties.into()); @@ -1404,6 +1643,45 @@ pub mod pools { self.action_filter = Some(action_filter.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(properties) = &this.properties { + req.url_mut() + .query_pairs_mut() + .append_pair("properties", properties); + } + if let Some(action_filter) = &this.action_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("actionFilter", &action_filter.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}", + self.client.endpoint(), + self.organization, + self.pool_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1412,9 +1690,7 @@ pub mod pools { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1426,35 +1702,24 @@ pub mod pools { auth_header, ); } - if let Some(properties) = &this.properties { - req.url_mut() - .query_pairs_mut() - .append_pair("properties", properties); - } - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", &action_filter.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}", - self.client.endpoint(), - self.organization, - self.pool_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1504,12 +1769,45 @@ pub mod pools { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TaskAgentPool, pub(crate) pool_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}", + self.client.endpoint(), + self.organization, + self.pool_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1519,9 +1817,7 @@ pub mod pools { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1533,26 +1829,24 @@ pub mod pools { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}", - self.client.endpoint(), - self.organization, - self.pool_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1597,11 +1891,43 @@ pub mod pools { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) pool_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}", + self.client.endpoint(), + self.organization, + self.pool_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1611,9 +1937,7 @@ pub mod pools { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1625,25 +1949,24 @@ pub mod pools { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}", - self.client.endpoint(), - self.organization, - self.pool_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1843,14 +2166,18 @@ pub mod queues { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) queue_names: String, pub(crate) project: String, pub(crate) action_filter: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Filter by whether the calling user has use or manage permissions"] pub fn action_filter( mut self, @@ -1859,6 +2186,45 @@ pub mod queues { self.action_filter = Some(action_filter.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let queue_names = &this.queue_names; + req.url_mut() + .query_pairs_mut() + .append_pair("queueNames", queue_names); + if let Some(action_filter) = &this.action_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("actionFilter", &action_filter.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/queues?queueNames={}", + self.client.endpoint(), + self.organization, + self.project, + self.queue_names + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1867,9 +2233,7 @@ pub mod queues { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1881,35 +2245,24 @@ pub mod queues { auth_header, ); } - let queue_names = &this.queue_names; - req.url_mut() - .query_pairs_mut() - .append_pair("queueNames", queue_names); - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", &action_filter.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/queues?queueNames={}", - self.client.endpoint(), - self.organization, - self.project, - self.queue_names - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1959,14 +2312,18 @@ pub mod queues { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) queue_ids: String, pub(crate) project: String, pub(crate) action_filter: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Filter by whether the calling user has use or manage permissions"] pub fn action_filter( mut self, @@ -1975,6 +2332,45 @@ pub mod queues { self.action_filter = Some(action_filter.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let queue_ids = &this.queue_ids; + req.url_mut() + .query_pairs_mut() + .append_pair("queueIds", queue_ids); + if let Some(action_filter) = &this.action_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("actionFilter", &action_filter.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/queues?queueIds={}", + self.client.endpoint(), + self.organization, + self.project, + self.queue_ids + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1983,9 +2379,7 @@ pub mod queues { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1997,35 +2391,24 @@ pub mod queues { auth_header, ); } - let queue_ids = &this.queue_ids; - req.url_mut() - .query_pairs_mut() - .append_pair("queueIds", queue_ids); - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", &action_filter.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/queues?queueIds={}", - self.client.endpoint(), - self.organization, - self.project, - self.queue_ids - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2075,14 +2458,18 @@ pub mod queues { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) queue_name: Option, pub(crate) action_filter: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Filter on the agent queue name"] pub fn queue_name(mut self, queue_name: impl Into) -> Self { self.queue_name = Some(queue_name.into()); @@ -2096,6 +2483,45 @@ pub mod queues { self.action_filter = Some(action_filter.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(queue_name) = &this.queue_name { + req.url_mut() + .query_pairs_mut() + .append_pair("queueName", queue_name); + } + if let Some(action_filter) = &this.action_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("actionFilter", &action_filter.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/queues?", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2104,9 +2530,7 @@ pub mod queues { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2118,35 +2542,24 @@ pub mod queues { auth_header, ); } - if let Some(queue_name) = &this.queue_name { - req.url_mut() - .query_pairs_mut() - .append_pair("queueName", queue_name); - } - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", &action_filter.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/queues?", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2196,14 +2609,18 @@ pub mod queues { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) pool_ids: String, pub(crate) project: String, pub(crate) action_filter: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Filter by whether the calling user has use or manage permissions"] pub fn action_filter( mut self, @@ -2212,42 +2629,27 @@ pub mod queues { self.action_filter = Some(action_filter.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - let pool_ids = &this.pool_ids; - req.url_mut() - .query_pairs_mut() - .append_pair("poolIds", pool_ids); - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", &action_filter.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let pool_ids = &this.pool_ids; + req.url_mut() + .query_pairs_mut() + .append_pair("poolIds", pool_ids); + if let Some(action_filter) = &this.action_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("actionFilter", &action_filter.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -2264,6 +2666,47 @@ pub mod queues { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -2311,19 +2754,58 @@ pub mod queues { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TaskAgentQueue, pub(crate) project: String, pub(crate) authorize_pipelines: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Automatically authorize this queue when using YAML"] pub fn authorize_pipelines(mut self, authorize_pipelines: bool) -> Self { self.authorize_pipelines = Some(authorize_pipelines); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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", &authorize_pipelines.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/queues", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2332,9 +2814,7 @@ pub mod queues { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2346,32 +2826,24 @@ pub mod queues { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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", - &authorize_pipelines.to_string(), - ); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/queues", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2421,14 +2893,18 @@ pub mod queues { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) queue_id: i32, pub(crate) project: String, pub(crate) action_filter: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Filter by whether the calling user has use or manage permissions"] pub fn action_filter( mut self, @@ -2437,6 +2913,41 @@ pub mod queues { self.action_filter = Some(action_filter.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(action_filter) = &this.action_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("actionFilter", &action_filter.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/queues/{}", + self.client.endpoint(), + self.organization, + self.project, + self.queue_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2445,9 +2956,7 @@ pub mod queues { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2459,31 +2968,24 @@ pub mod queues { auth_header, ); } - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", &action_filter.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/queues/{}", - self.client.endpoint(), - self.organization, - self.project, - self.queue_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2528,12 +3030,45 @@ pub mod queues { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) queue_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/queues/{}", + self.client.endpoint(), + self.organization, + self.project, + self.queue_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2543,9 +3078,7 @@ pub mod queues { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2557,26 +3090,24 @@ pub mod queues { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/queues/{}", - self.client.endpoint(), - self.organization, - self.project, - self.queue_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2766,8 +3297,12 @@ pub mod variablegroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) group_name: Option, @@ -2776,7 +3311,7 @@ pub mod variablegroups { pub(crate) continuation_token: Option, pub(crate) query_order: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Name of variable group."] pub fn group_name(mut self, group_name: impl Into) -> Self { self.group_name = Some(group_name.into()); @@ -2808,6 +3343,60 @@ pub mod variablegroups { self.query_order = Some(query_order.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(group_name) = &this.group_name { + req.url_mut() + .query_pairs_mut() + .append_pair("groupName", group_name); + } + if let Some(action_filter) = &this.action_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("actionFilter", &action_filter.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", &continuation_token.to_string()); + } + if let Some(query_order) = &this.query_order { + req.url_mut() + .query_pairs_mut() + .append_pair("queryOrder", &query_order.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/variablegroups?", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2816,9 +3405,7 @@ pub mod variablegroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2830,50 +3417,24 @@ pub mod variablegroups { auth_header, ); } - if let Some(group_name) = &this.group_name { - req.url_mut() - .query_pairs_mut() - .append_pair("groupName", group_name); - } - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", &action_filter.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", &continuation_token.to_string()); - } - if let Some(query_order) = &this.query_order { - req.url_mut() - .query_pairs_mut() - .append_pair("queryOrder", &query_order.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/variablegroups?", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2923,11 +3484,43 @@ pub mod variablegroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::VariableGroupParameters, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2937,9 +3530,7 @@ pub mod variablegroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2951,25 +3542,24 @@ pub mod variablegroups { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3014,12 +3604,48 @@ pub mod variablegroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) variable_group_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3029,9 +3655,7 @@ pub mod variablegroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3043,29 +3667,24 @@ pub mod variablegroups { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3118,24 +3737,55 @@ pub mod variablegroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::VariableGroupParameters, pub(crate) group_id: i32, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/variablegroups/{}", + self.client.endpoint(), + self.organization, + self.group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3147,26 +3797,24 @@ pub mod variablegroups { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/variablegroups/{}", - self.client.endpoint(), - self.organization, - self.group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3211,12 +3859,48 @@ pub mod variablegroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) group_id: i32, pub(crate) project_ids: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let project_ids = &this.project_ids; + req.url_mut() + .query_pairs_mut() + .append_pair("projectIds", project_ids); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/variablegroups/{}", + self.client.endpoint(), + self.organization, + self.group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3226,9 +3910,7 @@ pub mod variablegroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3240,29 +3922,24 @@ pub mod variablegroups { auth_header, ); } - let project_ids = &this.project_ids; - req.url_mut() - .query_pairs_mut() - .append_pair("projectIds", project_ids); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/variablegroups/{}", - self.client.endpoint(), - self.organization, - self.group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3315,12 +3992,48 @@ pub mod variablegroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) group_ids: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let group_ids = &this.group_ids; + req.url_mut() + .query_pairs_mut() + .append_pair("groupIds", group_ids); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/variablegroups", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3330,9 +4043,7 @@ pub mod variablegroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3344,29 +4055,24 @@ pub mod variablegroups { auth_header, ); } - let group_ids = &this.group_ids; - req.url_mut() - .query_pairs_mut() - .append_pair("groupIds", group_ids); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/variablegroups", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3416,12 +4122,45 @@ pub mod variablegroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) group_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/variablegroups/{}", + self.client.endpoint(), + self.organization, + self.project, + self.group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3431,9 +4170,7 @@ pub mod variablegroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3445,26 +4182,24 @@ pub mod variablegroups { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/variablegroups/{}", - self.client.endpoint(), - self.organization, - self.project, - self.group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3586,10 +4321,41 @@ pub mod agentclouds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3599,9 +4365,7 @@ pub mod agentclouds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3613,24 +4377,24 @@ pub mod agentclouds { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3680,11 +4444,43 @@ pub mod agentclouds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TaskAgentCloud, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3694,9 +4490,7 @@ pub mod agentclouds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3708,25 +4502,24 @@ pub mod agentclouds { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3776,11 +4569,43 @@ pub mod agentclouds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) agent_cloud_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/agentclouds/{}", + self.client.endpoint(), + self.organization, + self.agent_cloud_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3790,9 +4615,7 @@ pub mod agentclouds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3804,25 +4627,24 @@ pub mod agentclouds { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/agentclouds/{}", - self.client.endpoint(), - self.organization, - self.agent_cloud_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3872,12 +4694,45 @@ pub mod agentclouds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TaskAgentCloud, pub(crate) agent_cloud_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/agentclouds/{}", + self.client.endpoint(), + self.organization, + self.agent_cloud_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3887,9 +4742,7 @@ pub mod agentclouds { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3901,26 +4754,24 @@ pub mod agentclouds { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/agentclouds/{}", - self.client.endpoint(), - self.organization, - self.agent_cloud_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3970,23 +4821,53 @@ pub mod agentclouds { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) agent_cloud_id: i32, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/agentclouds/{}", + self.client.endpoint(), + self.organization, + self.agent_cloud_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3998,25 +4879,24 @@ pub mod agentclouds { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/agentclouds/{}", - self.client.endpoint(), - self.organization, - self.agent_cloud_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4092,11 +4972,43 @@ pub mod requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) agent_cloud_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/agentclouds/{}/requests", + self.client.endpoint(), + self.organization, + self.agent_cloud_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4106,9 +5018,7 @@ pub mod requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4120,25 +5030,24 @@ pub mod requests { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/agentclouds/{}/requests", - self.client.endpoint(), - self.organization, - self.agent_cloud_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4212,10 +5121,41 @@ pub mod agentcloudtypes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4225,9 +5165,7 @@ pub mod agentcloudtypes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4239,24 +5177,24 @@ pub mod agentcloudtypes { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4440,8 +5378,12 @@ pub mod agents { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) pool_id: i32, pub(crate) agent_name: Option, @@ -4451,7 +5393,7 @@ pub mod agents { pub(crate) property_filters: Option, pub(crate) demands: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Filter on agent name"] pub fn agent_name(mut self, agent_name: impl Into) -> Self { self.agent_name = Some(agent_name.into()); @@ -4485,6 +5427,67 @@ pub mod agents { self.demands = Some(demands.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(agent_name) = &this.agent_name { + req.url_mut() + .query_pairs_mut() + .append_pair("agentName", agent_name); + } + if let Some(include_capabilities) = &this.include_capabilities { + req.url_mut() + .query_pairs_mut() + .append_pair("includeCapabilities", &include_capabilities.to_string()); + } + if let Some(include_assigned_request) = &this.include_assigned_request { + req.url_mut().query_pairs_mut().append_pair( + "includeAssignedRequest", + &include_assigned_request.to_string(), + ); + } + if let Some(include_last_completed_request) = &this.include_last_completed_request { + req.url_mut().query_pairs_mut().append_pair( + "includeLastCompletedRequest", + &include_last_completed_request.to_string(), + ); + } + if let Some(property_filters) = &this.property_filters { + req.url_mut() + .query_pairs_mut() + .append_pair("propertyFilters", property_filters); + } + if let Some(demands) = &this.demands { + req.url_mut() + .query_pairs_mut() + .append_pair("demands", demands); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}/agents", + self.client.endpoint(), + self.organization, + self.pool_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4493,9 +5496,7 @@ pub mod agents { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4507,60 +5508,24 @@ pub mod agents { auth_header, ); } - if let Some(agent_name) = &this.agent_name { - req.url_mut() - .query_pairs_mut() - .append_pair("agentName", agent_name); - } - if let Some(include_capabilities) = &this.include_capabilities { - req.url_mut().query_pairs_mut().append_pair( - "includeCapabilities", - &include_capabilities.to_string(), - ); - } - if let Some(include_assigned_request) = &this.include_assigned_request { - req.url_mut().query_pairs_mut().append_pair( - "includeAssignedRequest", - &include_assigned_request.to_string(), - ); - } - if let Some(include_last_completed_request) = - &this.include_last_completed_request - { - req.url_mut().query_pairs_mut().append_pair( - "includeLastCompletedRequest", - &include_last_completed_request.to_string(), - ); - } - if let Some(property_filters) = &this.property_filters { - req.url_mut() - .query_pairs_mut() - .append_pair("propertyFilters", property_filters); - } - if let Some(demands) = &this.demands { - req.url_mut() - .query_pairs_mut() - .append_pair("demands", demands); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}/agents", - self.client.endpoint(), - self.organization, - self.pool_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4610,12 +5575,45 @@ pub mod agents { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TaskAgent, pub(crate) pool_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}/agents", + self.client.endpoint(), + self.organization, + self.pool_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4625,9 +5623,7 @@ pub mod agents { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4639,26 +5635,24 @@ pub mod agents { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}/agents", - self.client.endpoint(), - self.organization, - self.pool_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4708,8 +5702,12 @@ pub mod agents { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) pool_id: i32, pub(crate) agent_id: i32, @@ -4718,7 +5716,7 @@ pub mod agents { pub(crate) include_last_completed_request: Option, pub(crate) property_filters: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Whether to include the agent's capabilities in the response"] pub fn include_capabilities(mut self, include_capabilities: bool) -> Self { self.include_capabilities = Some(include_capabilities); @@ -4742,6 +5740,58 @@ pub mod agents { self.property_filters = Some(property_filters.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_capabilities) = &this.include_capabilities { + req.url_mut() + .query_pairs_mut() + .append_pair("includeCapabilities", &include_capabilities.to_string()); + } + if let Some(include_assigned_request) = &this.include_assigned_request { + req.url_mut().query_pairs_mut().append_pair( + "includeAssignedRequest", + &include_assigned_request.to_string(), + ); + } + if let Some(include_last_completed_request) = &this.include_last_completed_request { + req.url_mut().query_pairs_mut().append_pair( + "includeLastCompletedRequest", + &include_last_completed_request.to_string(), + ); + } + if let Some(property_filters) = &this.property_filters { + req.url_mut() + .query_pairs_mut() + .append_pair("propertyFilters", property_filters); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}/agents/{}", + self.client.endpoint(), + self.organization, + self.pool_id, + self.agent_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4750,9 +5800,7 @@ pub mod agents { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4764,51 +5812,24 @@ pub mod agents { auth_header, ); } - if let Some(include_capabilities) = &this.include_capabilities { - req.url_mut().query_pairs_mut().append_pair( - "includeCapabilities", - &include_capabilities.to_string(), - ); - } - if let Some(include_assigned_request) = &this.include_assigned_request { - req.url_mut().query_pairs_mut().append_pair( - "includeAssignedRequest", - &include_assigned_request.to_string(), - ); - } - if let Some(include_last_completed_request) = - &this.include_last_completed_request - { - req.url_mut().query_pairs_mut().append_pair( - "includeLastCompletedRequest", - &include_last_completed_request.to_string(), - ); - } - if let Some(property_filters) = &this.property_filters { - req.url_mut() - .query_pairs_mut() - .append_pair("propertyFilters", property_filters); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}/agents/{}", - self.client.endpoint(), - self.organization, - self.pool_id, - self.agent_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4858,13 +5879,47 @@ pub mod agents { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TaskAgent, pub(crate) pool_id: i32, pub(crate) agent_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}/agents/{}", + self.client.endpoint(), + self.organization, + self.pool_id, + self.agent_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4874,9 +5929,7 @@ pub mod agents { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4888,27 +5941,24 @@ pub mod agents { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}/agents/{}", - self.client.endpoint(), - self.organization, - self.pool_id, - self.agent_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4958,13 +6008,47 @@ pub mod agents { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TaskAgent, pub(crate) pool_id: i32, pub(crate) agent_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}/agents/{}", + self.client.endpoint(), + self.organization, + self.pool_id, + self.agent_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4974,9 +6058,7 @@ pub mod agents { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4988,27 +6070,24 @@ pub mod agents { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}/agents/{}", - self.client.endpoint(), - self.organization, - self.pool_id, - self.agent_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5053,12 +6132,45 @@ pub mod agents { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) pool_id: i32, pub(crate) agent_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/pools/{}/agents/{}", + self.client.endpoint(), + self.organization, + self.pool_id, + self.agent_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5068,9 +6180,7 @@ pub mod agents { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5082,26 +6192,24 @@ pub mod agents { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/pools/{}/agents/{}", - self.client.endpoint(), - self.organization, - self.pool_id, - self.agent_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5175,17 +6283,54 @@ pub mod yamlschema { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) validate_task_names: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Whether the schema should validate that tasks are actually installed (useful for offline tools where you don't want validation)."] pub fn validate_task_names(mut self, validate_task_names: bool) -> Self { self.validate_task_names = Some(validate_task_names); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5194,9 +6339,7 @@ pub mod yamlschema { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5208,29 +6351,24 @@ pub mod yamlschema { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5393,8 +6531,12 @@ pub mod deploymentgroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) name: Option, @@ -5404,7 +6546,7 @@ pub mod deploymentgroups { pub(crate) top: Option, pub(crate) ids: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Name of the deployment group."] pub fn name(mut self, name: impl Into) -> Self { self.name = Some(name.into()); @@ -5438,6 +6580,61 @@ pub mod deploymentgroups { self.ids = Some(ids.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(name) = &this.name { + req.url_mut().query_pairs_mut().append_pair("name", name); + } + if let Some(action_filter) = &this.action_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("actionFilter", &action_filter.to_string()); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(ids) = &this.ids { + req.url_mut().query_pairs_mut().append_pair("ids", ids); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5446,9 +6643,7 @@ pub mod deploymentgroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5460,51 +6655,24 @@ pub mod deploymentgroups { auth_header, ); } - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", &action_filter.to_string()); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(ids) = &this.ids { - req.url_mut().query_pairs_mut().append_pair("ids", ids); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5554,12 +6722,45 @@ pub mod deploymentgroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::DeploymentGroupCreateParameter, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5569,9 +6770,7 @@ pub mod deploymentgroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5583,26 +6782,24 @@ pub mod deploymentgroups { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5652,15 +6849,19 @@ pub mod deploymentgroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) deployment_group_id: i32, pub(crate) action_filter: Option, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Get the deployment group only if this action can be performed on it."] pub fn action_filter( mut self, @@ -5674,6 +6875,46 @@ pub mod deploymentgroups { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(action_filter) = &this.action_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("actionFilter", &action_filter.to_string()); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", + self.client.endpoint(), + self.organization, + self.project, + self.deployment_group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5682,9 +6923,7 @@ pub mod deploymentgroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5696,36 +6935,24 @@ pub mod deploymentgroups { auth_header, ); } - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", &action_filter.to_string()); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", - self.client.endpoint(), - self.organization, - self.project, - self.deployment_group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5775,13 +7002,47 @@ pub mod deploymentgroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::DeploymentGroupUpdateParameter, pub(crate) project: String, pub(crate) deployment_group_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", + self.client.endpoint(), + self.organization, + self.project, + self.deployment_group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5791,9 +7052,7 @@ pub mod deploymentgroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5805,27 +7064,24 @@ pub mod deploymentgroups { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", - self.client.endpoint(), - self.organization, - self.project, - self.deployment_group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5870,14 +7126,47 @@ pub mod deploymentgroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) deployment_group_id: i32, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", + self.client.endpoint(), + self.organization, + self.project, + self.deployment_group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] #[doc = "However, this function can provide more flexibility when required."] @@ -5885,9 +7174,7 @@ pub mod deploymentgroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5899,26 +7186,24 @@ pub mod deploymentgroups { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}", - self.client.endpoint(), - self.organization, - self.project, - self.deployment_group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6077,8 +7362,12 @@ pub mod targets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) deployment_group_id: i32, @@ -6093,7 +7382,7 @@ pub mod targets { pub(crate) enabled: Option, pub(crate) property_filters: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Get only the deployment targets that contain all these comma separted list of tags."] pub fn tags(mut self, tags: impl Into) -> Self { self.tags = Some(tags.into()); @@ -6149,6 +7438,82 @@ pub mod targets { self.property_filters = Some(property_filters.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(tags) = &this.tags { + req.url_mut().query_pairs_mut().append_pair("tags", tags); + } + if let Some(name) = &this.name { + req.url_mut().query_pairs_mut().append_pair("name", name); + } + if let Some(partial_name_match) = &this.partial_name_match { + req.url_mut() + .query_pairs_mut() + .append_pair("partialNameMatch", &partial_name_match.to_string()); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + if let Some(agent_status) = &this.agent_status { + req.url_mut() + .query_pairs_mut() + .append_pair("agentStatus", &agent_status.to_string()); + } + if let Some(agent_job_result) = &this.agent_job_result { + req.url_mut() + .query_pairs_mut() + .append_pair("agentJobResult", &agent_job_result.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(enabled) = &this.enabled { + req.url_mut() + .query_pairs_mut() + .append_pair("enabled", &enabled.to_string()); + } + if let Some(property_filters) = &this.property_filters { + req.url_mut() + .query_pairs_mut() + .append_pair("propertyFilters", property_filters); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets", + self.client.endpoint(), + self.organization, + self.project, + self.deployment_group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6157,9 +7522,7 @@ pub mod targets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6171,72 +7534,24 @@ pub mod targets { auth_header, ); } - if let Some(tags) = &this.tags { - req.url_mut().query_pairs_mut().append_pair("tags", tags); - } - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - if let Some(partial_name_match) = &this.partial_name_match { - req.url_mut() - .query_pairs_mut() - .append_pair("partialNameMatch", &partial_name_match.to_string()); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - if let Some(agent_status) = &this.agent_status { - req.url_mut() - .query_pairs_mut() - .append_pair("agentStatus", &agent_status.to_string()); - } - if let Some(agent_job_result) = &this.agent_job_result { - req.url_mut() - .query_pairs_mut() - .append_pair("agentJobResult", &agent_job_result.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(enabled) = &this.enabled { - req.url_mut() - .query_pairs_mut() - .append_pair("enabled", &enabled.to_string()); - } - if let Some(property_filters) = &this.property_filters { - req.url_mut() - .query_pairs_mut() - .append_pair("propertyFilters", property_filters); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets", - self.client.endpoint(), - self.organization, - self.project, - self.deployment_group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6286,13 +7601,47 @@ pub mod targets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) deployment_group_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets", + self.client.endpoint(), + self.organization, + self.project, + self.deployment_group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6302,9 +7651,7 @@ pub mod targets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6316,27 +7663,24 @@ pub mod targets { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets", - self.client.endpoint(), - self.organization, - self.project, - self.deployment_group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6386,20 +7730,60 @@ pub mod targets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) deployment_group_id: i32, pub(crate) target_id: i32, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Include these additional details in the returned objects."] pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets/{}", + self.client.endpoint(), + self.organization, + self.project, + self.deployment_group_id, + self.target_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6408,9 +7792,7 @@ pub mod targets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6422,32 +7804,24 @@ pub mod targets { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets/{}", - self.client.endpoint(), - self.organization, - self.project, - self.deployment_group_id, - self.target_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6492,13 +7866,47 @@ pub mod targets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) deployment_group_id: i32, pub(crate) target_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets/{}", + self.client.endpoint(), + self.organization, + self.project, + self.deployment_group_id, + self.target_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6508,9 +7916,7 @@ pub mod targets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6522,27 +7928,24 @@ pub mod targets { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets/{}", - self.client.endpoint(), - self.organization, - self.project, - self.deployment_group_id, - self.target_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6707,15 +8110,19 @@ pub mod environments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) name: Option, pub(crate) continuation_token: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn name(mut self, name: impl Into) -> Self { self.name = Some(name.into()); self @@ -6728,6 +8135,48 @@ pub mod environments { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(name) = &this.name { + req.url_mut().query_pairs_mut().append_pair("name", name); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6736,9 +8185,7 @@ pub mod environments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6750,38 +8197,24 @@ pub mod environments { auth_header, ); } - if let Some(name) = &this.name { - req.url_mut().query_pairs_mut().append_pair("name", name); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6832,12 +8265,45 @@ pub mod environments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::EnvironmentCreateParameter, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6847,9 +8313,7 @@ pub mod environments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6861,26 +8325,24 @@ pub mod environments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6930,19 +8392,58 @@ pub mod environments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) environment_id: i32, pub(crate) expands: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Include these additional details in the returned objects."] pub fn expands(mut self, expands: impl Into) -> Self { self.expands = Some(expands.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expands) = &this.expands { + req.url_mut() + .query_pairs_mut() + .append_pair("expands", &expands.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.environment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6951,9 +8452,7 @@ pub mod environments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6965,31 +8464,24 @@ pub mod environments { auth_header, ); } - if let Some(expands) = &this.expands { - req.url_mut() - .query_pairs_mut() - .append_pair("expands", &expands.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.environment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7039,13 +8531,47 @@ pub mod environments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::EnvironmentUpdateParameter, pub(crate) project: String, pub(crate) environment_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.environment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7055,9 +8581,7 @@ pub mod environments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7069,27 +8593,24 @@ pub mod environments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.environment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7134,12 +8655,45 @@ pub mod environments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) environment_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.environment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7149,9 +8703,7 @@ pub mod environments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7163,26 +8715,24 @@ pub mod environments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.environment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7270,15 +8820,19 @@ pub mod environmentdeployment_records { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) environment_id: i32, pub(crate) continuation_token: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { self.continuation_token = Some(continuation_token.into()); self @@ -7287,6 +8841,46 @@ pub mod environmentdeployment_records { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}/environmentdeploymentrecords", + self.client.endpoint(), + self.organization, + self.project, + self.environment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7295,9 +8889,7 @@ pub mod environmentdeployment_records { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7309,36 +8901,24 @@ pub mod environmentdeployment_records { auth_header, ); } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("top", &top.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments/{}/environmentdeploymentrecords", - self.client.endpoint(), - self.organization, - self.project, - self.environment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7455,13 +9035,47 @@ pub mod kubernetes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::KubernetesResourceCreateParameters, pub(crate) project: String, pub(crate) environment_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes", + self.client.endpoint(), + self.organization, + self.project, + self.environment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7471,9 +9085,7 @@ pub mod kubernetes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7485,27 +9097,24 @@ pub mod kubernetes { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes", - self.client.endpoint(), - self.organization, - self.project, - self.environment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7555,13 +9164,47 @@ pub mod kubernetes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) environment_id: i32, pub(crate) resource_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes/{}", + self.client.endpoint(), + self.organization, + self.project, + self.environment_id, + self.resource_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7571,9 +9214,7 @@ pub mod kubernetes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7585,27 +9226,24 @@ pub mod kubernetes { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes/{}", - self.client.endpoint(), - self.organization, - self.project, - self.environment_id, - self.resource_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7650,13 +9288,47 @@ pub mod kubernetes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) environment_id: i32, pub(crate) resource_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes/{}", + self.client.endpoint(), + self.organization, + self.project, + self.environment_id, + self.resource_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7666,9 +9338,7 @@ pub mod kubernetes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7680,27 +9350,24 @@ pub mod kubernetes { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes/{}", - self.client.endpoint(), - self.organization, - self.project, - self.environment_id, - self.resource_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7849,12 +9516,45 @@ pub mod taskgroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TaskGroupCreateParameter, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/taskgroups", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7864,9 +9564,7 @@ pub mod taskgroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7878,26 +9576,24 @@ pub mod taskgroups { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/taskgroups", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7947,8 +9643,12 @@ pub mod taskgroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) task_group_id: String, @@ -7959,7 +9659,7 @@ pub mod taskgroups { pub(crate) continuation_token: Option, pub(crate) query_order: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "'true' to recursively expand task groups. Default is 'false'."] pub fn expanded(mut self, expanded: bool) -> Self { self.expanded = Some(expanded); @@ -7996,6 +9696,68 @@ pub mod taskgroups { self.query_order = Some(query_order.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expanded) = &this.expanded { + req.url_mut() + .query_pairs_mut() + .append_pair("expanded", &expanded.to_string()); + } + if let Some(task_id_filter) = &this.task_id_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("taskIdFilter", task_id_filter); + } + if let Some(deleted) = &this.deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("deleted", &deleted.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .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", &formatted_date_time); + } + if let Some(query_order) = &this.query_order { + req.url_mut() + .query_pairs_mut() + .append_pair("queryOrder", &query_order.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/taskgroups/{}", + self.client.endpoint(), + self.organization, + self.project, + self.task_group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8004,9 +9766,7 @@ pub mod taskgroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8018,58 +9778,24 @@ pub mod taskgroups { auth_header, ); } - if let Some(expanded) = &this.expanded { - req.url_mut() - .query_pairs_mut() - .append_pair("expanded", &expanded.to_string()); - } - if let Some(task_id_filter) = &this.task_id_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("taskIdFilter", task_id_filter); - } - if let Some(deleted) = &this.deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("deleted", &deleted.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .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", &formatted_date_time); - } - if let Some(query_order) = &this.query_order { - req.url_mut() - .query_pairs_mut() - .append_pair("queryOrder", &query_order.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/taskgroups/{}", - self.client.endpoint(), - self.organization, - self.project, - self.task_group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8119,13 +9845,47 @@ pub mod taskgroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TaskGroupUpdateParameter, pub(crate) project: String, pub(crate) task_group_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/taskgroups/{}", + self.client.endpoint(), + self.organization, + self.project, + self.task_group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8135,9 +9895,7 @@ pub mod taskgroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8149,27 +9907,24 @@ pub mod taskgroups { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/taskgroups/{}", - self.client.endpoint(), - self.organization, - self.project, - self.task_group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8214,19 +9969,58 @@ pub mod taskgroups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) task_group_id: String, pub(crate) comment: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Comments to delete."] pub fn comment(mut self, comment: impl Into) -> Self { self.comment = Some(comment.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + if let Some(comment) = &this.comment { + req.url_mut() + .query_pairs_mut() + .append_pair("comment", comment); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/distributedtask/taskgroups/{}", + self.client.endpoint(), + self.organization, + self.project, + self.task_group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8235,9 +10029,7 @@ pub mod taskgroups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8249,31 +10041,24 @@ pub mod taskgroups { auth_header, ); } - if let Some(comment) = &this.comment { - req.url_mut() - .query_pairs_mut() - .append_pair("comment", comment); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/distributedtask/taskgroups/{}", - self.client.endpoint(), - self.organization, - self.project, - self.task_group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8398,10 +10183,41 @@ pub mod elasticpools { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8411,9 +10227,7 @@ pub mod elasticpools { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8425,24 +10239,24 @@ pub mod elasticpools { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8495,8 +10309,12 @@ pub mod elasticpools { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ElasticPool, pub(crate) pool_name: String, @@ -8504,7 +10322,7 @@ pub mod elasticpools { pub(crate) auto_provision_project_pools: Option, pub(crate) project_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Setting to determine if all pipelines are authorized to use this TaskAgentPool by default."] pub fn authorize_all_pipelines(mut self, authorize_all_pipelines: bool) -> Self { self.authorize_all_pipelines = Some(authorize_all_pipelines); @@ -8523,6 +10341,56 @@ pub mod elasticpools { self.project_id = Some(project_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + let pool_name = &this.pool_name; + req.url_mut() + .query_pairs_mut() + .append_pair("poolName", pool_name); + if let Some(authorize_all_pipelines) = &this.authorize_all_pipelines { + req.url_mut().query_pairs_mut().append_pair( + "authorizeAllPipelines", + &authorize_all_pipelines.to_string(), + ); + } + if let Some(auto_provision_project_pools) = &this.auto_provision_project_pools { + req.url_mut().query_pairs_mut().append_pair( + "autoProvisionProjectPools", + &auto_provision_project_pools.to_string(), + ); + } + 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(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8531,9 +10399,7 @@ pub mod elasticpools { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8545,48 +10411,24 @@ pub mod elasticpools { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - let pool_name = &this.pool_name; - req.url_mut() - .query_pairs_mut() - .append_pair("poolName", pool_name); - if let Some(authorize_all_pipelines) = &this.authorize_all_pipelines { - req.url_mut().query_pairs_mut().append_pair( - "authorizeAllPipelines", - &authorize_all_pipelines.to_string(), - ); - } - if let Some(auto_provision_project_pools) = - &this.auto_provision_project_pools - { - req.url_mut().query_pairs_mut().append_pair( - "autoProvisionProjectPools", - &auto_provision_project_pools.to_string(), - ); - } - 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?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8637,11 +10479,43 @@ pub mod elasticpools { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) pool_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/elasticpools/{}", + self.client.endpoint(), + self.organization, + self.pool_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8651,9 +10525,7 @@ pub mod elasticpools { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8665,25 +10537,24 @@ pub mod elasticpools { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/elasticpools/{}", - self.client.endpoint(), - self.organization, - self.pool_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8733,13 +10604,46 @@ pub mod elasticpools { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ElasticPoolSettings, pub(crate) pool_id: i32, } - impl RequestBuilder { + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/elasticpools/{}", + self.client.endpoint(), + self.organization, + self.pool_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8748,9 +10652,7 @@ pub mod elasticpools { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8762,26 +10664,24 @@ pub mod elasticpools { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/elasticpools/{}", - self.client.endpoint(), - self.organization, - self.pool_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8854,18 +10754,56 @@ pub mod elasticpoollogs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) pool_id: i32, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Number of elastic pool logs to retrieve"] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/elasticpools/{}/logs", + self.client.endpoint(), + self.organization, + self.pool_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8874,9 +10812,7 @@ pub mod elasticpoollogs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8888,30 +10824,24 @@ pub mod elasticpoollogs { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/elasticpools/{}/logs", - self.client.endpoint(), - self.organization, - self.pool_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9003,18 +10933,56 @@ pub mod nodes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) pool_id: i32, pub(crate) state: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Optional: Filter to only retrieve ElasticNodes in the given ElasticNodeState"] pub fn state(mut self, state: impl Into) -> Self { self.state = Some(state.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(state) = &this.state { + req.url_mut() + .query_pairs_mut() + .append_pair("$state", &state.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/elasticpools/{}/nodes", + self.client.endpoint(), + self.organization, + self.pool_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -9023,9 +10991,7 @@ pub mod nodes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9037,30 +11003,24 @@ pub mod nodes { auth_header, ); } - if let Some(state) = &this.state { - req.url_mut() - .query_pairs_mut() - .append_pair("$state", &state.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/elasticpools/{}/nodes", - self.client.endpoint(), - self.organization, - self.pool_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9110,13 +11070,47 @@ pub mod nodes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ElasticNodeSettings, pub(crate) pool_id: i32, pub(crate) elastic_node_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/distributedtask/elasticpools/{}/nodes/{}", + self.client.endpoint(), + self.organization, + self.pool_id, + self.elastic_node_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9126,9 +11120,7 @@ pub mod nodes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9140,27 +11132,24 @@ pub mod nodes { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/distributedtask/elasticpools/{}/nodes/{}", - self.client.endpoint(), - self.organization, - self.pool_id, - self.elastic_node_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9177,3 +11166,1426 @@ pub mod nodes { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn agentclouds_client(&self) -> agentclouds::Client { + agentclouds::Client(self.clone()) + } + pub fn agentcloudtypes_client(&self) -> agentcloudtypes::Client { + agentcloudtypes::Client(self.clone()) + } + pub fn agents_client(&self) -> agents::Client { + agents::Client(self.clone()) + } + pub fn deploymentgroups_client(&self) -> deploymentgroups::Client { + deploymentgroups::Client(self.clone()) + } + pub fn elasticpoollogs_client(&self) -> elasticpoollogs::Client { + elasticpoollogs::Client(self.clone()) + } + pub fn elasticpools_client(&self) -> elasticpools::Client { + elasticpools::Client(self.clone()) + } + pub fn environmentdeployment_records_client( + &self, + ) -> environmentdeployment_records::Client { + environmentdeployment_records::Client(self.clone()) + } + pub fn environments_client(&self) -> environments::Client { + environments::Client(self.clone()) + } + pub fn events_client(&self) -> events::Client { + events::Client(self.clone()) + } + pub fn kubernetes_client(&self) -> kubernetes::Client { + kubernetes::Client(self.clone()) + } + pub fn logs_client(&self) -> logs::Client { + logs::Client(self.clone()) + } + pub fn nodes_client(&self) -> nodes::Client { + nodes::Client(self.clone()) + } + pub fn oidctoken_client(&self) -> oidctoken::Client { + oidctoken::Client(self.clone()) + } + pub fn pools_client(&self) -> pools::Client { + pools::Client(self.clone()) + } + pub fn queues_client(&self) -> queues::Client { + queues::Client(self.clone()) + } + pub fn records_client(&self) -> records::Client { + records::Client(self.clone()) + } + pub fn requests_client(&self) -> requests::Client { + requests::Client(self.clone()) + } + pub fn targets_client(&self) -> targets::Client { + targets::Client(self.clone()) + } + pub fn taskgroups_client(&self) -> taskgroups::Client { + taskgroups::Client(self.clone()) + } + pub fn variablegroups_client(&self) -> variablegroups::Client { + variablegroups::Client(self.clone()) + } + pub fn yamlschema_client(&self) -> yamlschema::Client { + yamlschema::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod events { + use super::super::events::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Send a pipeline job event to be processed by the execution plan."] + #[doc = ""] + #[doc = "See [`post_event`](super::super::events::Client::post_event) for details of the arguments."] + pub fn post_event( + &self, + organization: impl Into, + body: impl Into, + scope_identifier: impl Into, + hub_name: impl Into, + plan_id: impl Into, + ) -> post_event::RequestBuilder { + post_event::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + scope_identifier: scope_identifier.into(), + hub_name: hub_name.into(), + plan_id: plan_id.into(), + } + } + } + } + pub mod oidctoken { + use super::super::models; + use super::super::oidctoken::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`create`](super::super::oidctoken::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + scope_identifier: impl Into, + hub_name: impl Into, + plan_id: impl Into, + job_id: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + scope_identifier: scope_identifier.into(), + hub_name: hub_name.into(), + plan_id: plan_id.into(), + job_id: job_id.into(), + service_connection_id: None, + } + } + } + } + pub mod logs { + use super::super::logs::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Create a log and connect it to a pipeline run's execution plan."] + #[doc = ""] + #[doc = "See [`create`](super::super::logs::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + scope_identifier: impl Into, + hub_name: impl Into, + plan_id: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + scope_identifier: scope_identifier.into(), + hub_name: hub_name.into(), + plan_id: plan_id.into(), + } + } + #[doc = "Append a log to a task's log. The log should be sent in the body of the request as a TaskLog object stream."] + #[doc = ""] + #[doc = "See [`append_log_content`](super::super::logs::Client::append_log_content) for details of the arguments."] + pub fn append_log_content( + &self, + organization: impl Into, + body: impl Into, + scope_identifier: impl Into, + hub_name: impl Into, + plan_id: impl Into, + log_id: i32, + ) -> append_log_content::RequestBuilder { + append_log_content::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + scope_identifier: scope_identifier.into(), + hub_name: hub_name.into(), + plan_id: plan_id.into(), + log_id, + } + } + } + } + pub mod records { + use super::super::models; + use super::super::records::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Update timeline records if they already exist, otherwise create new ones for the same timeline."] + #[doc = ""] + #[doc = "See [`update`](super::super::records::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + scope_identifier: impl Into, + hub_name: impl Into, + plan_id: impl Into, + timeline_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + scope_identifier: scope_identifier.into(), + hub_name: hub_name.into(), + plan_id: plan_id.into(), + timeline_id: timeline_id.into(), + } + } + } + } + pub mod pools { + use super::super::models; + use super::super::pools::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of agent pools."] + #[doc = ""] + #[doc = "See [`get_agent_pools`](super::super::pools::Client::get_agent_pools) for details of the arguments."] + pub fn get_agent_pools( + &self, + organization: impl Into, + ) -> get_agent_pools::RequestBuilder { + get_agent_pools::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_name: None, + properties: None, + pool_type: None, + action_filter: None, + } + } + #[doc = "Get a list of agent pools."] + #[doc = ""] + #[doc = "See [`get_agent_pools_by_ids`](super::super::pools::Client::get_agent_pools_by_ids) for details of the arguments."] + pub fn get_agent_pools_by_ids( + &self, + organization: impl Into, + pool_ids: impl Into, + ) -> get_agent_pools_by_ids::RequestBuilder { + get_agent_pools_by_ids::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_ids: pool_ids.into(), + action_filter: None, + } + } + #[doc = "Create an agent pool."] + #[doc = ""] + #[doc = "See [`add`](super::super::pools::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Get information about an agent pool."] + #[doc = ""] + #[doc = "See [`get`](super::super::pools::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + pool_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_id, + properties: None, + action_filter: None, + } + } + #[doc = "Update properties on an agent pool"] + #[doc = ""] + #[doc = "See [`update`](super::super::pools::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + pool_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + pool_id, + } + } + #[doc = "Delete an agent pool."] + #[doc = ""] + #[doc = "See [`delete`](super::super::pools::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + pool_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_id, + } + } + } + } + pub mod queues { + use super::super::models; + use super::super::queues::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of agent queues by their names"] + #[doc = ""] + #[doc = "See [`get_agent_queues_by_names`](super::super::queues::Client::get_agent_queues_by_names) for details of the arguments."] + pub fn get_agent_queues_by_names( + &self, + organization: impl Into, + queue_names: impl Into, + project: impl Into, + ) -> get_agent_queues_by_names::RequestBuilder { + get_agent_queues_by_names::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + queue_names: queue_names.into(), + project: project.into(), + action_filter: None, + } + } + #[doc = "Get a list of agent queues by their IDs"] + #[doc = ""] + #[doc = "See [`get_agent_queues_by_ids`](super::super::queues::Client::get_agent_queues_by_ids) for details of the arguments."] + pub fn get_agent_queues_by_ids( + &self, + organization: impl Into, + queue_ids: impl Into, + project: impl Into, + ) -> get_agent_queues_by_ids::RequestBuilder { + get_agent_queues_by_ids::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + queue_ids: queue_ids.into(), + project: project.into(), + action_filter: None, + } + } + #[doc = "Get a list of agent queues."] + #[doc = ""] + #[doc = "See [`get_agent_queues`](super::super::queues::Client::get_agent_queues) for details of the arguments."] + pub fn get_agent_queues( + &self, + organization: impl Into, + project: impl Into, + ) -> get_agent_queues::RequestBuilder { + get_agent_queues::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + queue_name: None, + action_filter: None, + } + } + #[doc = "Get a list of agent queues by pool ids"] + #[doc = ""] + #[doc = "See [`get_agent_queues_for_pools`](super::super::queues::Client::get_agent_queues_for_pools) for details of the arguments."] + pub fn get_agent_queues_for_pools( + &self, + organization: impl Into, + pool_ids: impl Into, + project: impl Into, + ) -> get_agent_queues_for_pools::RequestBuilder { + get_agent_queues_for_pools::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_ids: pool_ids.into(), + project: project.into(), + action_filter: None, + } + } + #[doc = "Create a new agent queue to connect a project to an agent pool."] + #[doc = ""] + #[doc = "See [`add`](super::super::queues::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + authorize_pipelines: None, + } + } + #[doc = "Get information about an agent queue."] + #[doc = ""] + #[doc = "See [`get`](super::super::queues::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + queue_id: i32, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + queue_id, + project: project.into(), + action_filter: None, + } + } + #[doc = "Removes an agent queue from a project."] + #[doc = ""] + #[doc = "See [`delete`](super::super::queues::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + queue_id: i32, + project: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + queue_id, + project: project.into(), + } + } + } + } + pub mod variablegroups { + use super::super::models; + use super::super::variablegroups::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get variable groups."] + #[doc = ""] + #[doc = "See [`get_variable_groups`](super::super::variablegroups::Client::get_variable_groups) for details of the arguments."] + pub fn get_variable_groups( + &self, + organization: impl Into, + project: impl Into, + ) -> get_variable_groups::RequestBuilder { + get_variable_groups::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + group_name: None, + action_filter: None, + top: None, + continuation_token: None, + query_order: None, + } + } + #[doc = "Add a variable group."] + #[doc = ""] + #[doc = "See [`add`](super::super::variablegroups::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Add a variable group."] + #[doc = ""] + #[doc = "See [`share_variable_group`](super::super::variablegroups::Client::share_variable_group) for details of the arguments."] + pub fn share_variable_group( + &self, + organization: impl Into, + body: Vec, + variable_group_id: i32, + ) -> share_variable_group::RequestBuilder { + share_variable_group::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + variable_group_id, + } + } + #[doc = "Update a variable group."] + #[doc = ""] + #[doc = "See [`update`](super::super::variablegroups::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + group_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + group_id, + } + } + #[doc = "Delete a variable group"] + #[doc = ""] + #[doc = "See [`delete`](super::super::variablegroups::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + group_id: i32, + project_ids: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + group_id, + project_ids: project_ids.into(), + } + } + #[doc = "Get variable groups by ids."] + #[doc = ""] + #[doc = "See [`get_variable_groups_by_id`](super::super::variablegroups::Client::get_variable_groups_by_id) for details of the arguments."] + pub fn get_variable_groups_by_id( + &self, + organization: impl Into, + project: impl Into, + group_ids: impl Into, + ) -> get_variable_groups_by_id::RequestBuilder { + get_variable_groups_by_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + group_ids: group_ids.into(), + } + } + #[doc = "Get a variable group."] + #[doc = ""] + #[doc = "See [`get`](super::super::variablegroups::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + group_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + group_id, + } + } + } + } + pub mod agentclouds { + use super::super::agentclouds::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`list`](super::super::agentclouds::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "See [`add`](super::super::agentclouds::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "See [`get`](super::super::agentclouds::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + agent_cloud_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + agent_cloud_id, + } + } + #[doc = "See [`update`](super::super::agentclouds::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + agent_cloud_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + agent_cloud_id, + } + } + #[doc = "See [`delete`](super::super::agentclouds::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + agent_cloud_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + agent_cloud_id, + } + } + } + } + pub mod requests { + use super::super::models; + use super::super::requests::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`list`](super::super::requests::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + agent_cloud_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + agent_cloud_id, + } + } + } + } + pub mod agentcloudtypes { + use super::super::agentcloudtypes::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get agent cloud types."] + #[doc = ""] + #[doc = "See [`list`](super::super::agentcloudtypes::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + } + } + pub mod agents { + use super::super::agents::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of agents."] + #[doc = ""] + #[doc = "See [`list`](super::super::agents::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + pool_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_id, + agent_name: None, + include_capabilities: None, + include_assigned_request: None, + include_last_completed_request: None, + property_filters: None, + demands: None, + } + } + #[doc = "Adds an agent to a pool. You probably don't want to call this endpoint directly. Instead, [configure an agent](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) using the agent download package."] + #[doc = ""] + #[doc = "See [`add`](super::super::agents::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + pool_id: i32, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + pool_id, + } + } + #[doc = "Get information about an agent."] + #[doc = ""] + #[doc = "See [`get`](super::super::agents::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + pool_id: i32, + agent_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_id, + agent_id, + include_capabilities: None, + include_assigned_request: None, + include_last_completed_request: None, + property_filters: None, + } + } + #[doc = "Replace an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove and reconfigure an agent from your organization."] + #[doc = ""] + #[doc = "See [`replace_agent`](super::super::agents::Client::replace_agent) for details of the arguments."] + pub fn replace_agent( + &self, + organization: impl Into, + body: impl Into, + pool_id: i32, + agent_id: i32, + ) -> replace_agent::RequestBuilder { + replace_agent::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + pool_id, + agent_id, + } + } + #[doc = "Update agent details."] + #[doc = ""] + #[doc = "See [`update`](super::super::agents::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + pool_id: i32, + agent_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + pool_id, + agent_id, + } + } + #[doc = "Delete an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove an agent from your organization."] + #[doc = ""] + #[doc = "See [`delete`](super::super::agents::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + pool_id: i32, + agent_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_id, + agent_id, + } + } + } + } + pub mod yamlschema { + use super::super::models; + use super::super::yamlschema::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "GET the Yaml schema used for Yaml file validation."] + #[doc = ""] + #[doc = "See [`get`](super::super::yamlschema::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + validate_task_names: None, + } + } + } + } + pub mod deploymentgroups { + use super::super::deploymentgroups::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of deployment groups by name or IDs."] + #[doc = ""] + #[doc = "See [`list`](super::super::deploymentgroups::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + name: None, + action_filter: None, + expand: None, + continuation_token: None, + top: None, + ids: None, + } + } + #[doc = "Create a deployment group."] + #[doc = ""] + #[doc = "See [`add`](super::super::deploymentgroups::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get a deployment group by its ID."] + #[doc = ""] + #[doc = "See [`get`](super::super::deploymentgroups::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + deployment_group_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + deployment_group_id, + action_filter: None, + expand: None, + } + } + #[doc = "Update a deployment group."] + #[doc = ""] + #[doc = "See [`update`](super::super::deploymentgroups::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + deployment_group_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + deployment_group_id, + } + } + #[doc = "Delete a deployment group."] + #[doc = ""] + #[doc = "See [`delete`](super::super::deploymentgroups::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + deployment_group_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + deployment_group_id, + } + } + } + } + pub mod targets { + use super::super::models; + use super::super::targets::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of deployment targets in a deployment group."] + #[doc = ""] + #[doc = "See [`list`](super::super::targets::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + deployment_group_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + deployment_group_id, + tags: None, + name: None, + partial_name_match: None, + expand: None, + agent_status: None, + agent_job_result: None, + continuation_token: None, + top: None, + enabled: None, + property_filters: None, + } + } + #[doc = "Update tags of a list of deployment targets in a deployment group."] + #[doc = ""] + #[doc = "See [`update`](super::super::targets::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + deployment_group_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + deployment_group_id, + } + } + #[doc = "Get a deployment target by its ID in a deployment group"] + #[doc = ""] + #[doc = "See [`get`](super::super::targets::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + deployment_group_id: i32, + target_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + deployment_group_id, + target_id, + expand: None, + } + } + #[doc = "Delete a deployment target in a deployment group. This deletes the agent from associated deployment pool too."] + #[doc = ""] + #[doc = "See [`delete`](super::super::targets::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + deployment_group_id: i32, + target_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + deployment_group_id, + target_id, + } + } + } + } + pub mod environments { + use super::super::environments::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all environments."] + #[doc = ""] + #[doc = "See [`list`](super::super::environments::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + name: None, + continuation_token: None, + top: None, + } + } + #[doc = "Create an environment."] + #[doc = ""] + #[doc = "See [`add`](super::super::environments::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get an environment by its ID."] + #[doc = ""] + #[doc = "See [`get`](super::super::environments::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + environment_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + environment_id, + expands: None, + } + } + #[doc = "Update the specified environment."] + #[doc = ""] + #[doc = "See [`update`](super::super::environments::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + environment_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + environment_id, + } + } + #[doc = "Delete the specified environment."] + #[doc = ""] + #[doc = "See [`delete`](super::super::environments::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + environment_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + environment_id, + } + } + } + } + pub mod environmentdeployment_records { + use super::super::environmentdeployment_records::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get environment deployment execution history"] + #[doc = ""] + #[doc = "See [`list`](super::super::environmentdeployment_records::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + environment_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + environment_id, + continuation_token: None, + top: None, + } + } + } + } + pub mod kubernetes { + use super::super::kubernetes::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`add`](super::super::kubernetes::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + environment_id: i32, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + environment_id, + } + } + #[doc = "See [`get`](super::super::kubernetes::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + environment_id: i32, + resource_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + environment_id, + resource_id, + } + } + #[doc = "See [`delete`](super::super::kubernetes::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + environment_id: i32, + resource_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + environment_id, + resource_id, + } + } + } + } + pub mod taskgroups { + use super::super::models; + use super::super::taskgroups::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Create a task group."] + #[doc = ""] + #[doc = "See [`add`](super::super::taskgroups::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "List task groups."] + #[doc = ""] + #[doc = "See [`list`](super::super::taskgroups::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + task_group_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + task_group_id: task_group_id.into(), + expanded: None, + task_id_filter: None, + deleted: None, + top: None, + continuation_token: None, + query_order: None, + } + } + #[doc = "Update a task group."] + #[doc = ""] + #[doc = "See [`update`](super::super::taskgroups::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + task_group_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + task_group_id: task_group_id.into(), + } + } + #[doc = "Delete a task group."] + #[doc = ""] + #[doc = "See [`delete`](super::super::taskgroups::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + task_group_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + task_group_id: task_group_id.into(), + comment: None, + } + } + } + } + pub mod elasticpools { + use super::super::elasticpools::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of all Elastic Pools."] + #[doc = ""] + #[doc = "See [`list`](super::super::elasticpools::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Create a new elastic pool. This will create a new TaskAgentPool at the organization level. If a project id is provided, this will create a new TaskAgentQueue in the specified project."] + #[doc = ""] + #[doc = "See [`create`](super::super::elasticpools::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + pool_name: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + pool_name: pool_name.into(), + authorize_all_pipelines: None, + auto_provision_project_pools: None, + project_id: None, + } + } + #[doc = "Returns the Elastic Pool with the specified Pool Id."] + #[doc = ""] + #[doc = "See [`get`](super::super::elasticpools::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + pool_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_id, + } + } + #[doc = "Update settings on a specified Elastic Pool."] + #[doc = ""] + #[doc = "See [`update`](super::super::elasticpools::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + pool_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + pool_id, + } + } + } + } + pub mod elasticpoollogs { + use super::super::elasticpoollogs::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get elastic pool diagnostics logs for a specified Elastic Pool."] + #[doc = ""] + #[doc = "See [`list`](super::super::elasticpoollogs::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + pool_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_id, + top: None, + } + } + } + } + pub mod nodes { + use super::super::models; + use super::super::nodes::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of ElasticNodes currently in the ElasticPool"] + #[doc = ""] + #[doc = "See [`list`](super::super::nodes::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + pool_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pool_id, + state: None, + } + } + #[doc = "Update properties on a specified ElasticNode"] + #[doc = ""] + #[doc = "See [`update`](super::super::nodes::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + pool_id: i32, + elastic_node_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + pool_id, + elastic_node_id, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/extension_management/mod.rs b/azure_devops_rust_api/src/extension_management/mod.rs index 601e358f..c43afd55 100644 --- a/azure_devops_rust_api/src/extension_management/mod.rs +++ b/azure_devops_rust_api/src/extension_management/mod.rs @@ -271,15 +271,19 @@ pub mod installed_extensions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) include_disabled_extensions: Option, pub(crate) include_errors: Option, pub(crate) asset_types: Option, pub(crate) include_installation_issues: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If true (the default), include disabled extensions in the results."] pub fn include_disabled_extensions( mut self, @@ -305,6 +309,56 @@ pub mod installed_extensions { self.include_installation_issues = Some(include_installation_issues); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_disabled_extensions) = &this.include_disabled_extensions { + req.url_mut().query_pairs_mut().append_pair( + "includeDisabledExtensions", + &include_disabled_extensions.to_string(), + ); + } + if let Some(include_errors) = &this.include_errors { + req.url_mut() + .query_pairs_mut() + .append_pair("includeErrors", &include_errors.to_string()); + } + if let Some(asset_types) = &this.asset_types { + req.url_mut() + .query_pairs_mut() + .append_pair("assetTypes", asset_types); + } + if let Some(include_installation_issues) = &this.include_installation_issues { + req.url_mut().query_pairs_mut().append_pair( + "includeInstallationIssues", + &include_installation_issues.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -313,9 +367,7 @@ pub mod installed_extensions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -327,48 +379,24 @@ pub mod installed_extensions { auth_header, ); } - if let Some(include_disabled_extensions) = &this.include_disabled_extensions - { - req.url_mut().query_pairs_mut().append_pair( - "includeDisabledExtensions", - &include_disabled_extensions.to_string(), - ); - } - if let Some(include_errors) = &this.include_errors { - req.url_mut() - .query_pairs_mut() - .append_pair("includeErrors", &include_errors.to_string()); - } - if let Some(asset_types) = &this.asset_types { - req.url_mut() - .query_pairs_mut() - .append_pair("assetTypes", asset_types); - } - if let Some(include_installation_issues) = &this.include_installation_issues - { - req.url_mut().query_pairs_mut().append_pair( - "includeInstallationIssues", - &include_installation_issues.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -419,11 +447,43 @@ pub mod installed_extensions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::InstalledExtension, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -433,9 +493,7 @@ pub mod installed_extensions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -447,25 +505,24 @@ pub mod installed_extensions { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -515,19 +572,58 @@ pub mod installed_extensions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) publisher_name: String, pub(crate) extension_name: String, pub(crate) asset_types: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Determines which files are returned in the files array. Provide the wildcard '*' to return all files, or a colon separated list to retrieve files with specific asset types."] pub fn asset_types(mut self, asset_types: impl Into) -> Self { self.asset_types = Some(asset_types.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(asset_types) = &this.asset_types { + req.url_mut() + .query_pairs_mut() + .append_pair("assetTypes", asset_types); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}", + self.client.endpoint(), + self.organization, + self.publisher_name, + self.extension_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -536,9 +632,7 @@ pub mod installed_extensions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -550,31 +644,24 @@ pub mod installed_extensions { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}", - self.client.endpoint(), - self.organization, - self.publisher_name, - self.extension_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -619,15 +706,19 @@ pub mod installed_extensions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) publisher_name: String, pub(crate) extension_name: String, pub(crate) reason: Option, pub(crate) reason_code: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn reason(mut self, reason: impl Into) -> Self { self.reason = Some(reason.into()); self @@ -636,6 +727,46 @@ pub mod installed_extensions { self.reason_code = Some(reason_code.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + if let Some(reason) = &this.reason { + req.url_mut() + .query_pairs_mut() + .append_pair("reason", reason); + } + if let Some(reason_code) = &this.reason_code { + req.url_mut() + .query_pairs_mut() + .append_pair("reasonCode", reason_code); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}", + self.client.endpoint(), + self.organization, + self.publisher_name, + self.extension_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -644,9 +775,7 @@ pub mod installed_extensions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -658,36 +787,24 @@ pub mod installed_extensions { auth_header, ); } - if let Some(reason) = &this.reason { - req.url_mut() - .query_pairs_mut() - .append_pair("reason", reason); - } - if let Some(reason_code) = &this.reason_code { - req.url_mut() - .query_pairs_mut() - .append_pair("reasonCode", reason_code); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}", - self.client.endpoint(), - self.organization, - self.publisher_name, - self.extension_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -740,13 +857,48 @@ pub mod installed_extensions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) publisher_name: String, pub(crate) extension_name: String, pub(crate) version: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}/{}", + self.client.endpoint(), + self.organization, + self.publisher_name, + self.extension_name, + self.version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -756,9 +908,7 @@ pub mod installed_extensions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -770,28 +920,24 @@ pub mod installed_extensions { auth_header, ); } - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/extensionmanagement/installedextensionsbyname/{}/{}/{}", - self.client.endpoint(), - self.organization, - self.publisher_name, - self.extension_name, - self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -808,3 +954,175 @@ pub mod installed_extensions { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn installed_extensions_client(&self) -> installed_extensions::Client { + installed_extensions::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod installed_extensions { + use super::super::installed_extensions::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List the installed extensions in the account / project collection."] + #[doc = ""] + #[doc = "See [`list`](super::super::installed_extensions::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + include_disabled_extensions: None, + include_errors: None, + asset_types: None, + include_installation_issues: None, + } + } + #[doc = "Update an installed extension. Typically this API is used to enable or disable an extension."] + #[doc = ""] + #[doc = "See [`update`](super::super::installed_extensions::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Get an installed extension by its publisher and extension name."] + #[doc = ""] + #[doc = "See [`get`](super::super::installed_extensions::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + publisher_name: impl Into, + extension_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + publisher_name: publisher_name.into(), + extension_name: extension_name.into(), + asset_types: None, + } + } + #[doc = "Uninstall the specified extension from the account / project collection."] + #[doc = ""] + #[doc = "See [`uninstall_extension_by_name`](super::super::installed_extensions::Client::uninstall_extension_by_name) for details of the arguments."] + pub fn uninstall_extension_by_name( + &self, + organization: impl Into, + publisher_name: impl Into, + extension_name: impl Into, + ) -> uninstall_extension_by_name::RequestBuilder { + uninstall_extension_by_name::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + publisher_name: publisher_name.into(), + extension_name: extension_name.into(), + reason: None, + reason_code: None, + } + } + #[doc = "Install the specified extension into the account / project collection."] + #[doc = ""] + #[doc = "See [`install_extension_by_name`](super::super::installed_extensions::Client::install_extension_by_name) for details of the arguments."] + pub fn install_extension_by_name( + &self, + organization: impl Into, + publisher_name: impl Into, + extension_name: impl Into, + version: impl Into, + ) -> install_extension_by_name::RequestBuilder { + install_extension_by_name::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + publisher_name: publisher_name.into(), + extension_name: extension_name.into(), + version: version.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/favorite/mod.rs b/azure_devops_rust_api/src/favorite/mod.rs index a6946a92..bd146a41 100644 --- a/azure_devops_rust_api/src/favorite/mod.rs +++ b/azure_devops_rust_api/src/favorite/mod.rs @@ -342,8 +342,12 @@ pub mod favorites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) owner_scope_type: String, pub(crate) owner_scope_id: String, @@ -352,7 +356,7 @@ pub mod favorites { pub(crate) artifact_scope_id: Option, pub(crate) include_extended_details: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn artifact_type(mut self, artifact_type: impl Into) -> Self { self.artifact_type = Some(artifact_type.into()); self @@ -369,6 +373,65 @@ pub mod favorites { self.include_extended_details = Some(include_extended_details); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let owner_scope_type = &this.owner_scope_type; + req.url_mut() + .query_pairs_mut() + .append_pair("ownerScopeType", owner_scope_type); + let owner_scope_id = &this.owner_scope_id; + req.url_mut() + .query_pairs_mut() + .append_pair("ownerScopeId", owner_scope_id); + if let Some(artifact_type) = &this.artifact_type { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactType", artifact_type); + } + if let Some(artifact_scope_type) = &this.artifact_scope_type { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeType", artifact_scope_type); + } + if let Some(artifact_scope_id) = &this.artifact_scope_id { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeId", artifact_scope_id); + } + if let Some(include_extended_details) = &this.include_extended_details { + req.url_mut().query_pairs_mut().append_pair( + "includeExtendedDetails", + &include_extended_details.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/favorite/favorites?ownerScopeType={}&ownerScopeId={}", + self.client.endpoint(), + self.organization, + self.owner_scope_type, + self.owner_scope_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -377,9 +440,7 @@ pub mod favorites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -391,55 +452,24 @@ pub mod favorites { auth_header, ); } - let owner_scope_type = &this.owner_scope_type; - req.url_mut() - .query_pairs_mut() - .append_pair("ownerScopeType", owner_scope_type); - let owner_scope_id = &this.owner_scope_id; - req.url_mut() - .query_pairs_mut() - .append_pair("ownerScopeId", owner_scope_id); - if let Some(artifact_type) = &this.artifact_type { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactType", artifact_type); - } - if let Some(artifact_scope_type) = &this.artifact_scope_type { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeType", artifact_scope_type); - } - if let Some(artifact_scope_id) = &this.artifact_scope_id { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeId", artifact_scope_id); - } - if let Some(include_extended_details) = &this.include_extended_details { - req.url_mut().query_pairs_mut().append_pair( - "includeExtendedDetails", - &include_extended_details.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/favorite/favorites?ownerScopeType={}&ownerScopeId={}", - self.client.endpoint(), - self.organization, - self.owner_scope_type, - self.owner_scope_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -489,13 +519,55 @@ pub mod favorites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::FavoriteCreateParameters, pub(crate) owner_scope_type: String, pub(crate) owner_scope_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + let owner_scope_type = &this.owner_scope_type; + req.url_mut() + .query_pairs_mut() + .append_pair("ownerScopeType", owner_scope_type); + let owner_scope_id = &this.owner_scope_id; + req.url_mut() + .query_pairs_mut() + .append_pair("ownerScopeId", owner_scope_id); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/favorite/favorites?ownerScopeType={}&ownerScopeId={}", + self.client.endpoint(), + self.organization, + self.owner_scope_type, + self.owner_scope_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -505,9 +577,7 @@ pub mod favorites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -519,35 +589,24 @@ pub mod favorites { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - let owner_scope_type = &this.owner_scope_type; - req.url_mut() - .query_pairs_mut() - .append_pair("ownerScopeType", owner_scope_type); - let owner_scope_id = &this.owner_scope_id; - req.url_mut() - .query_pairs_mut() - .append_pair("ownerScopeId", owner_scope_id); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/favorite/favorites?ownerScopeType={}&ownerScopeId={}", - self.client.endpoint(), - self.organization, - self.owner_scope_type, - self.owner_scope_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -597,8 +656,12 @@ pub mod favorites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) artifact_type: String, pub(crate) artifact_id: String, @@ -606,7 +669,7 @@ pub mod favorites { pub(crate) artifact_scope_id: Option, pub(crate) include_extended_details: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into) -> Self { self.artifact_scope_id = Some(artifact_scope_id.into()); self @@ -615,6 +678,53 @@ pub mod favorites { self.include_extended_details = Some(include_extended_details); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let artifact_type = &this.artifact_type; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactType", artifact_type); + let artifact_id = &this.artifact_id; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactId", artifact_id); + let artifact_scope_type = &this.artifact_scope_type; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeType", artifact_scope_type); + if let Some(artifact_scope_id) = &this.artifact_scope_id { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeId", artifact_scope_id); + } + if let Some(include_extended_details) = &this.include_extended_details { + req.url_mut().query_pairs_mut().append_pair( + "includeExtendedDetails", + &include_extended_details.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -623,9 +733,7 @@ pub mod favorites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -637,43 +745,24 @@ pub mod favorites { auth_header, ); } - let artifact_type = &this.artifact_type; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactType", artifact_type); - let artifact_id = &this.artifact_id; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactId", artifact_id); - let artifact_scope_type = &this.artifact_scope_type; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeType", artifact_scope_type); - if let Some(artifact_scope_id) = &this.artifact_scope_id { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeId", artifact_scope_id); - } - if let Some(include_extended_details) = &this.include_extended_details { - req.url_mut().query_pairs_mut().append_pair( - "includeExtendedDetails", - &include_extended_details.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -718,8 +807,12 @@ pub mod favorites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) favorite_id: String, pub(crate) owner_scope_type: String, @@ -728,11 +821,56 @@ pub mod favorites { pub(crate) artifact_scope_type: String, pub(crate) artifact_scope_id: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into) -> Self { self.artifact_scope_id = Some(artifact_scope_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let owner_scope_type = &this.owner_scope_type; + req.url_mut() + .query_pairs_mut() + .append_pair("ownerScopeType", owner_scope_type); + let owner_scope_id = &this.owner_scope_id; + req.url_mut() + .query_pairs_mut() + .append_pair("ownerScopeId", owner_scope_id); + let artifact_type = &this.artifact_type; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactType", artifact_type); + let artifact_scope_type = &this.artifact_scope_type; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeType", artifact_scope_type); + if let Some(artifact_scope_id) = &this.artifact_scope_id { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeId", artifact_scope_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -741,9 +879,7 @@ pub mod favorites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -755,41 +891,24 @@ pub mod favorites { auth_header, ); } - let owner_scope_type = &this.owner_scope_type; - req.url_mut() - .query_pairs_mut() - .append_pair("ownerScopeType", owner_scope_type); - let owner_scope_id = &this.owner_scope_id; - req.url_mut() - .query_pairs_mut() - .append_pair("ownerScopeId", owner_scope_id); - let artifact_type = &this.artifact_type; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactType", artifact_type); - let artifact_scope_type = &this.artifact_scope_type; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeType", artifact_scope_type); - if let Some(artifact_scope_id) = &this.artifact_scope_id { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeId", artifact_scope_id); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -842,8 +961,12 @@ pub mod favorites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) favorite_id: String, pub(crate) owner_scope_type: String, @@ -853,7 +976,7 @@ pub mod favorites { pub(crate) artifact_scope_id: Option, pub(crate) include_extended_details: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into) -> Self { self.artifact_scope_id = Some(artifact_scope_id.into()); self @@ -862,6 +985,57 @@ pub mod favorites { self.include_extended_details = Some(include_extended_details); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let owner_scope_type = &this.owner_scope_type; + req.url_mut() + .query_pairs_mut() + .append_pair("ownerScopeType", owner_scope_type); + let owner_scope_id = &this.owner_scope_id; + req.url_mut() + .query_pairs_mut() + .append_pair("ownerScopeId", owner_scope_id); + let artifact_scope_type = &this.artifact_scope_type; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeType", artifact_scope_type); + let artifact_type = &this.artifact_type; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactType", artifact_type); + if let Some(artifact_scope_id) = &this.artifact_scope_id { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeId", artifact_scope_id); + } + if let Some(include_extended_details) = &this.include_extended_details { + req.url_mut().query_pairs_mut().append_pair( + "includeExtendedDetails", + &include_extended_details.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -870,9 +1044,7 @@ pub mod favorites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -884,47 +1056,24 @@ pub mod favorites { auth_header, ); } - let owner_scope_type = &this.owner_scope_type; - req.url_mut() - .query_pairs_mut() - .append_pair("ownerScopeType", owner_scope_type); - let owner_scope_id = &this.owner_scope_id; - req.url_mut() - .query_pairs_mut() - .append_pair("ownerScopeId", owner_scope_id); - let artifact_scope_type = &this.artifact_scope_type; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeType", artifact_scope_type); - let artifact_type = &this.artifact_type; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactType", artifact_type); - if let Some(artifact_scope_id) = &this.artifact_scope_id { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeId", artifact_scope_id); - } - if let Some(include_extended_details) = &this.include_extended_details { - req.url_mut().query_pairs_mut().append_pair( - "includeExtendedDetails", - &include_extended_details.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -974,15 +1123,19 @@ pub mod favorites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) artifact_type: Option, pub(crate) artifact_scope_type: Option, pub(crate) artifact_scope_id: Option, pub(crate) include_extended_details: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn artifact_type(mut self, artifact_type: impl Into) -> Self { self.artifact_type = Some(artifact_type.into()); self @@ -999,6 +1152,55 @@ pub mod favorites { self.include_extended_details = Some(include_extended_details); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(artifact_type) = &this.artifact_type { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactType", artifact_type); + } + if let Some(artifact_scope_type) = &this.artifact_scope_type { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeType", artifact_scope_type); + } + if let Some(artifact_scope_id) = &this.artifact_scope_id { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeId", artifact_scope_id); + } + if let Some(include_extended_details) = &this.include_extended_details { + req.url_mut().query_pairs_mut().append_pair( + "includeExtendedDetails", + &include_extended_details.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1007,9 +1209,7 @@ pub mod favorites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1021,45 +1221,24 @@ pub mod favorites { auth_header, ); } - if let Some(artifact_type) = &this.artifact_type { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactType", artifact_type); - } - if let Some(artifact_scope_type) = &this.artifact_scope_type { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeType", artifact_scope_type); - } - if let Some(artifact_scope_id) = &this.artifact_scope_id { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeId", artifact_scope_id); - } - if let Some(include_extended_details) = &this.include_extended_details { - req.url_mut().query_pairs_mut().append_pair( - "includeExtendedDetails", - &include_extended_details.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1109,11 +1288,43 @@ pub mod favorites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::FavoriteCreateParameters, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1123,9 +1334,7 @@ pub mod favorites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1137,25 +1346,24 @@ pub mod favorites { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1205,8 +1413,12 @@ pub mod favorites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) favorite_id: String, pub(crate) artifact_scope_type: String, @@ -1214,7 +1426,7 @@ pub mod favorites { pub(crate) artifact_scope_id: Option, pub(crate) include_extended_details: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into) -> Self { self.artifact_scope_id = Some(artifact_scope_id.into()); self @@ -1223,6 +1435,54 @@ pub mod favorites { self.include_extended_details = Some(include_extended_details); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let artifact_scope_type = &this.artifact_scope_type; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeType", artifact_scope_type); + let artifact_type = &this.artifact_type; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactType", artifact_type); + if let Some(artifact_scope_id) = &this.artifact_scope_id { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeId", artifact_scope_id); + } + if let Some(include_extended_details) = &this.include_extended_details { + req.url_mut().query_pairs_mut().append_pair( + "includeExtendedDetails", + &include_extended_details.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/favorite/favorites/{}", + self.client.endpoint(), + self.organization, + self.favorite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1231,9 +1491,7 @@ pub mod favorites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1245,44 +1503,24 @@ pub mod favorites { auth_header, ); } - let artifact_scope_type = &this.artifact_scope_type; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeType", artifact_scope_type); - let artifact_type = &this.artifact_type; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactType", artifact_type); - if let Some(artifact_scope_id) = &this.artifact_scope_id { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeId", artifact_scope_id); - } - if let Some(include_extended_details) = &this.include_extended_details { - req.url_mut().query_pairs_mut().append_pair( - "includeExtendedDetails", - &include_extended_details.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/favorite/favorites/{}", - self.client.endpoint(), - self.organization, - self.favorite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1327,19 +1565,65 @@ pub mod favorites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) favorite_id: String, pub(crate) artifact_type: String, pub(crate) artifact_scope_type: String, pub(crate) artifact_scope_id: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn artifact_scope_id(mut self, artifact_scope_id: impl Into) -> Self { self.artifact_scope_id = Some(artifact_scope_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let artifact_type = &this.artifact_type; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactType", artifact_type); + let artifact_scope_type = &this.artifact_scope_type; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeType", artifact_scope_type); + if let Some(artifact_scope_id) = &this.artifact_scope_id { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactScopeId", artifact_scope_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/favorite/favorites/{}", + self.client.endpoint(), + self.organization, + self.favorite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1348,9 +1632,7 @@ pub mod favorites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1362,38 +1644,24 @@ pub mod favorites { auth_header, ); } - let artifact_type = &this.artifact_type; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactType", artifact_type); - let artifact_scope_type = &this.artifact_scope_type; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeType", artifact_scope_type); - if let Some(artifact_scope_id) = &this.artifact_scope_id { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactScopeId", artifact_scope_id); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/favorite/favorites/{}", - self.client.endpoint(), - self.organization, - self.favorite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1413,3 +1681,248 @@ pub mod favorites { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn favorites_client(&self) -> favorites::Client { + favorites::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod favorites { + use super::super::favorites::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`get_favorites_of_owner`](super::super::favorites::Client::get_favorites_of_owner) for details of the arguments."] + pub fn get_favorites_of_owner( + &self, + organization: impl Into, + owner_scope_type: impl Into, + owner_scope_id: impl Into, + ) -> get_favorites_of_owner::RequestBuilder { + get_favorites_of_owner::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + owner_scope_type: owner_scope_type.into(), + owner_scope_id: owner_scope_id.into(), + artifact_type: None, + artifact_scope_type: None, + artifact_scope_id: None, + include_extended_details: None, + } + } + #[doc = "See [`create_favorite_of_owner`](super::super::favorites::Client::create_favorite_of_owner) for details of the arguments."] + pub fn create_favorite_of_owner( + &self, + organization: impl Into, + body: impl Into, + owner_scope_type: impl Into, + owner_scope_id: impl Into, + ) -> create_favorite_of_owner::RequestBuilder { + create_favorite_of_owner::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + owner_scope_type: owner_scope_type.into(), + owner_scope_id: owner_scope_id.into(), + } + } + #[doc = "See [`get_favorite_by_artifact`](super::super::favorites::Client::get_favorite_by_artifact) for details of the arguments."] + pub fn get_favorite_by_artifact( + &self, + organization: impl Into, + artifact_type: impl Into, + artifact_id: impl Into, + artifact_scope_type: impl Into, + ) -> get_favorite_by_artifact::RequestBuilder { + get_favorite_by_artifact::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + artifact_type: artifact_type.into(), + artifact_id: artifact_id.into(), + artifact_scope_type: artifact_scope_type.into(), + artifact_scope_id: None, + include_extended_details: None, + } + } + #[doc = "See [`delete_favorite_of_owner_by_id`](super::super::favorites::Client::delete_favorite_of_owner_by_id) for details of the arguments."] + pub fn delete_favorite_of_owner_by_id( + &self, + organization: impl Into, + favorite_id: impl Into, + owner_scope_type: impl Into, + owner_scope_id: impl Into, + artifact_type: impl Into, + artifact_scope_type: impl Into, + ) -> delete_favorite_of_owner_by_id::RequestBuilder { + delete_favorite_of_owner_by_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + favorite_id: favorite_id.into(), + owner_scope_type: owner_scope_type.into(), + owner_scope_id: owner_scope_id.into(), + artifact_type: artifact_type.into(), + artifact_scope_type: artifact_scope_type.into(), + artifact_scope_id: None, + } + } + #[doc = "See [`get_favorite_of_owner_by_id`](super::super::favorites::Client::get_favorite_of_owner_by_id) for details of the arguments."] + pub fn get_favorite_of_owner_by_id( + &self, + organization: impl Into, + favorite_id: impl Into, + owner_scope_type: impl Into, + owner_scope_id: impl Into, + artifact_scope_type: impl Into, + artifact_type: impl Into, + ) -> get_favorite_of_owner_by_id::RequestBuilder { + get_favorite_of_owner_by_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + favorite_id: favorite_id.into(), + owner_scope_type: owner_scope_type.into(), + owner_scope_id: owner_scope_id.into(), + artifact_scope_type: artifact_scope_type.into(), + artifact_type: artifact_type.into(), + artifact_scope_id: None, + include_extended_details: None, + } + } + #[doc = "See [`get_favorites`](super::super::favorites::Client::get_favorites) for details of the arguments."] + pub fn get_favorites( + &self, + organization: impl Into, + ) -> get_favorites::RequestBuilder { + get_favorites::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + artifact_type: None, + artifact_scope_type: None, + artifact_scope_id: None, + include_extended_details: None, + } + } + #[doc = "See [`create_favorite`](super::super::favorites::Client::create_favorite) for details of the arguments."] + pub fn create_favorite( + &self, + organization: impl Into, + body: impl Into, + ) -> create_favorite::RequestBuilder { + create_favorite::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "See [`get_favorite_by_id`](super::super::favorites::Client::get_favorite_by_id) for details of the arguments."] + pub fn get_favorite_by_id( + &self, + organization: impl Into, + favorite_id: impl Into, + artifact_scope_type: impl Into, + artifact_type: impl Into, + ) -> get_favorite_by_id::RequestBuilder { + get_favorite_by_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + favorite_id: favorite_id.into(), + artifact_scope_type: artifact_scope_type.into(), + artifact_type: artifact_type.into(), + artifact_scope_id: None, + include_extended_details: None, + } + } + #[doc = "See [`delete_favorite_by_id`](super::super::favorites::Client::delete_favorite_by_id) for details of the arguments."] + pub fn delete_favorite_by_id( + &self, + organization: impl Into, + favorite_id: impl Into, + artifact_type: impl Into, + artifact_scope_type: impl Into, + ) -> delete_favorite_by_id::RequestBuilder { + delete_favorite_by_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + favorite_id: favorite_id.into(), + artifact_type: artifact_type.into(), + artifact_scope_type: artifact_scope_type.into(), + artifact_scope_id: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/git/mod.rs b/azure_devops_rust_api/src/git/mod.rs index b1fc195a..9e2167cd 100644 --- a/azure_devops_rust_api/src/git/mod.rs +++ b/azure_devops_rust_api/src/git/mod.rs @@ -477,13 +477,51 @@ pub mod repositories { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) include_parent: bool, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let include_parent = &this.include_parent; + req.url_mut() + .query_pairs_mut() + .append_pair("includeParent", &include_parent.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}?includeParent={}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.include_parent + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -493,9 +531,7 @@ pub mod repositories { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -507,31 +543,24 @@ pub mod repositories { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}?includeParent={}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.include_parent - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -584,11 +613,43 @@ pub mod repositories { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/deletedrepositories", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -598,9 +659,7 @@ pub mod repositories { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -612,25 +671,24 @@ pub mod repositories { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/deletedrepositories", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -684,11 +742,43 @@ pub mod repositories { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/recycleBin/repositories", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -698,9 +788,7 @@ pub mod repositories { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -712,25 +800,24 @@ pub mod repositories { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/recycleBin/repositories", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -781,13 +868,47 @@ pub mod repositories { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitRecycleBinRepositoryDetails, pub(crate) project: String, pub(crate) repository_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/recycleBin/repositories/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -797,9 +918,7 @@ pub mod repositories { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -811,27 +930,24 @@ pub mod repositories { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/recycleBin/repositories/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -876,12 +992,45 @@ pub mod repositories { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) repository_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/recycleBin/repositories/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -891,9 +1040,7 @@ pub mod repositories { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -905,26 +1052,24 @@ pub mod repositories { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/recycleBin/repositories/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -977,15 +1122,19 @@ pub mod repositories { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) include_links: Option, pub(crate) include_all_urls: Option, pub(crate) include_hidden: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "(optional) Set to true to include reference links. The default value is false."] pub fn include_links(mut self, include_links: bool) -> Self { self.include_links = Some(include_links); @@ -1001,6 +1150,50 @@ pub mod repositories { self.include_hidden = Some(include_hidden); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_links) = &this.include_links { + req.url_mut() + .query_pairs_mut() + .append_pair("includeLinks", &include_links.to_string()); + } + if let Some(include_all_urls) = &this.include_all_urls { + req.url_mut() + .query_pairs_mut() + .append_pair("includeAllUrls", &include_all_urls.to_string()); + } + if let Some(include_hidden) = &this.include_hidden { + req.url_mut() + .query_pairs_mut() + .append_pair("includeHidden", &include_hidden.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1009,9 +1202,7 @@ pub mod repositories { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1023,40 +1214,24 @@ pub mod repositories { auth_header, ); } - if let Some(include_links) = &this.include_links { - req.url_mut() - .query_pairs_mut() - .append_pair("includeLinks", &include_links.to_string()); - } - if let Some(include_all_urls) = &this.include_all_urls { - req.url_mut() - .query_pairs_mut() - .append_pair("includeAllUrls", &include_all_urls.to_string()); - } - if let Some(include_hidden) = &this.include_hidden { - req.url_mut() - .query_pairs_mut() - .append_pair("includeHidden", &include_hidden.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1106,19 +1281,58 @@ pub mod repositories { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitRepositoryCreateOptions, pub(crate) project: String, pub(crate) source_ref: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "\\[optional\\] Specify the source refs to use while creating a fork repo"] pub fn source_ref(mut self, source_ref: impl Into) -> Self { self.source_ref = Some(source_ref.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1127,9 +1341,7 @@ pub mod repositories { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1141,31 +1353,24 @@ pub mod repositories { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1215,12 +1420,45 @@ pub mod repositories { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1230,9 +1468,7 @@ pub mod repositories { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1244,26 +1480,24 @@ pub mod repositories { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1313,13 +1547,47 @@ pub mod repositories { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitRepository, pub(crate) repository_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1329,9 +1597,7 @@ pub mod repositories { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1343,27 +1609,24 @@ pub mod repositories { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1408,12 +1671,45 @@ pub mod repositories { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1423,9 +1719,7 @@ pub mod repositories { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1437,26 +1731,24 @@ pub mod repositories { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1658,8 +1950,12 @@ pub mod commits { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) project: String, @@ -1689,7 +1985,7 @@ pub mod commits { pub(crate) search_criteria_to_date: Option, pub(crate) search_criteria_user: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Number of entries to skip"] pub fn search_criteria_skip(mut self, search_criteria_skip: i32) -> Self { self.search_criteria_skip = Some(search_criteria_skip); @@ -1870,6 +2166,181 @@ pub mod commits { self.search_criteria_user = Some(search_criteria_user.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(search_criteria_skip) = &this.search_criteria_skip { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.$skip", &search_criteria_skip.to_string()); + } + if let Some(search_criteria_top) = &this.search_criteria_top { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.$top", &search_criteria_top.to_string()); + } + if let Some(search_criteria_author) = &this.search_criteria_author { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.author", search_criteria_author); + } + if let Some(search_criteria_compare_version_version) = + &this.search_criteria_compare_version_version + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.compareVersion.version", + search_criteria_compare_version_version, + ); + } + if let Some(search_criteria_compare_version_version_options) = + &this.search_criteria_compare_version_version_options + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.compareVersion.versionOptions", + &search_criteria_compare_version_version_options.to_string(), + ); + } + if let Some(search_criteria_compare_version_version_type) = + &this.search_criteria_compare_version_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.compareVersion.versionType", + &search_criteria_compare_version_version_type.to_string(), + ); + } + if let Some(search_criteria_exclude_deletes) = &this.search_criteria_exclude_deletes + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.excludeDeletes", + &search_criteria_exclude_deletes.to_string(), + ); + } + if let Some(search_criteria_from_commit_id) = &this.search_criteria_from_commit_id { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.fromCommitId", + search_criteria_from_commit_id, + ); + } + 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); + } + if let Some(search_criteria_history_mode) = &this.search_criteria_history_mode { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.historyMode", + &search_criteria_history_mode.to_string(), + ); + } + if let Some(search_criteria_include_links) = &this.search_criteria_include_links { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.includeLinks", + &search_criteria_include_links.to_string(), + ); + } + if let Some(search_criteria_include_push_data) = + &this.search_criteria_include_push_data + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.includePushData", + &search_criteria_include_push_data.to_string(), + ); + } + if let Some(search_criteria_include_user_image_url) = + &this.search_criteria_include_user_image_url + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.includeUserImageUrl", + &search_criteria_include_user_image_url.to_string(), + ); + } + if let Some(search_criteria_include_work_items) = + &this.search_criteria_include_work_items + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.includeWorkItems", + &search_criteria_include_work_items.to_string(), + ); + } + if let Some(search_criteria_item_path) = &this.search_criteria_item_path { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.itemPath", search_criteria_item_path); + } + if let Some(search_criteria_item_version_version) = + &this.search_criteria_item_version_version + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.itemVersion.version", + search_criteria_item_version_version, + ); + } + if let Some(search_criteria_item_version_version_options) = + &this.search_criteria_item_version_version_options + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.itemVersion.versionOptions", + &search_criteria_item_version_version_options.to_string(), + ); + } + if let Some(search_criteria_item_version_version_type) = + &this.search_criteria_item_version_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.itemVersion.versionType", + &search_criteria_item_version_version_type.to_string(), + ); + } + if let Some(search_criteria_show_oldest_commits_first) = + &this.search_criteria_show_oldest_commits_first + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.showOldestCommitsFirst", + &search_criteria_show_oldest_commits_first.to_string(), + ); + } + if let Some(search_criteria_to_commit_id) = &this.search_criteria_to_commit_id { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.toCommitId", search_criteria_to_commit_id); + } + 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); + } + if let Some(search_criteria_user) = &this.search_criteria_user { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.user", search_criteria_user); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commits?", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1878,9 +2349,7 @@ pub mod commits { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1892,183 +2361,24 @@ pub mod commits { auth_header, ); } - if let Some(search_criteria_skip) = &this.search_criteria_skip { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.$skip", - &search_criteria_skip.to_string(), - ); - } - if let Some(search_criteria_top) = &this.search_criteria_top { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.$top", - &search_criteria_top.to_string(), - ); - } - if let Some(search_criteria_author) = &this.search_criteria_author { - req.url_mut() - .query_pairs_mut() - .append_pair("searchCriteria.author", search_criteria_author); - } - if let Some(search_criteria_compare_version_version) = - &this.search_criteria_compare_version_version - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.compareVersion.version", - search_criteria_compare_version_version, - ); - } - if let Some(search_criteria_compare_version_version_options) = - &this.search_criteria_compare_version_version_options - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.compareVersion.versionOptions", - &search_criteria_compare_version_version_options.to_string(), - ); - } - if let Some(search_criteria_compare_version_version_type) = - &this.search_criteria_compare_version_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.compareVersion.versionType", - &search_criteria_compare_version_version_type.to_string(), - ); - } - if let Some(search_criteria_exclude_deletes) = - &this.search_criteria_exclude_deletes - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.excludeDeletes", - &search_criteria_exclude_deletes.to_string(), - ); - } - if let Some(search_criteria_from_commit_id) = - &this.search_criteria_from_commit_id - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.fromCommitId", - search_criteria_from_commit_id, - ); - } - 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); - } - if let Some(search_criteria_history_mode) = - &this.search_criteria_history_mode - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.historyMode", - &search_criteria_history_mode.to_string(), - ); - } - if let Some(search_criteria_include_links) = - &this.search_criteria_include_links - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.includeLinks", - &search_criteria_include_links.to_string(), - ); - } - if let Some(search_criteria_include_push_data) = - &this.search_criteria_include_push_data - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.includePushData", - &search_criteria_include_push_data.to_string(), - ); - } - if let Some(search_criteria_include_user_image_url) = - &this.search_criteria_include_user_image_url - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.includeUserImageUrl", - &search_criteria_include_user_image_url.to_string(), - ); - } - if let Some(search_criteria_include_work_items) = - &this.search_criteria_include_work_items - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.includeWorkItems", - &search_criteria_include_work_items.to_string(), - ); - } - if let Some(search_criteria_item_path) = &this.search_criteria_item_path { - req.url_mut() - .query_pairs_mut() - .append_pair("searchCriteria.itemPath", search_criteria_item_path); - } - if let Some(search_criteria_item_version_version) = - &this.search_criteria_item_version_version - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.itemVersion.version", - search_criteria_item_version_version, - ); - } - if let Some(search_criteria_item_version_version_options) = - &this.search_criteria_item_version_version_options - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.itemVersion.versionOptions", - &search_criteria_item_version_version_options.to_string(), - ); - } - if let Some(search_criteria_item_version_version_type) = - &this.search_criteria_item_version_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.itemVersion.versionType", - &search_criteria_item_version_version_type.to_string(), - ); - } - if let Some(search_criteria_show_oldest_commits_first) = - &this.search_criteria_show_oldest_commits_first - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.showOldestCommitsFirst", - &search_criteria_show_oldest_commits_first.to_string(), - ); - } - if let Some(search_criteria_to_commit_id) = - &this.search_criteria_to_commit_id - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.toCommitId", - search_criteria_to_commit_id, - ); - } - 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); - } - if let Some(search_criteria_user) = &this.search_criteria_user { - req.url_mut() - .query_pairs_mut() - .append_pair("searchCriteria.user", search_criteria_user); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commits?", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2118,8 +2428,12 @@ pub mod commits { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) push_id: i32, @@ -2128,7 +2442,7 @@ pub mod commits { pub(crate) skip: Option, pub(crate) include_links: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The maximum number of commits to return (\"get the top x commits\")."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -2144,6 +2458,55 @@ pub mod commits { self.include_links = Some(include_links); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let push_id = &this.push_id; + req.url_mut() + .query_pairs_mut() + .append_pair("pushId", &push_id.to_string()); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("skip", &skip.to_string()); + } + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commits", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2152,9 +2515,7 @@ pub mod commits { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2166,45 +2527,24 @@ pub mod commits { auth_header, ); } - let push_id = &this.push_id; - req.url_mut() - .query_pairs_mut() - .append_pair("pushId", &push_id.to_string()); - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("skip", &skip.to_string()); - } - 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commits", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2254,52 +2594,41 @@ pub mod commits { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) commit_id: String, pub(crate) repository_id: String, pub(crate) project: String, pub(crate) change_count: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The number of changes to include in the result."] pub fn change_count(mut self, change_count: i32) -> Self { self.change_count = Some(change_count); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - 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::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -2318,6 +2647,47 @@ pub mod commits { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -2365,8 +2735,12 @@ pub mod commits { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) commit_id: String, pub(crate) repository_id: String, @@ -2374,7 +2748,7 @@ pub mod commits { pub(crate) top: Option, pub(crate) skip: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The maximum number of changes to return."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -2385,6 +2759,47 @@ pub mod commits { self.skip = Some(skip); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("skip", &skip.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commits/{}/changes", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.commit_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2393,9 +2808,7 @@ pub mod commits { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2407,37 +2820,24 @@ pub mod commits { auth_header, ); } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("skip", &skip.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commits/{}/changes", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.commit_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2487,8 +2887,12 @@ pub mod commits { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitQueryCommitsCriteria, pub(crate) repository_id: String, @@ -2497,7 +2901,7 @@ pub mod commits { pub(crate) top: Option, pub(crate) include_statuses: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Number of commits to skip. The value cannot exceed 3,000,000."] pub fn skip(mut self, skip: i32) -> Self { self.skip = Some(skip); @@ -2513,6 +2917,52 @@ pub mod commits { self.include_statuses = Some(include_statuses); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(include_statuses) = &this.include_statuses { + req.url_mut() + .query_pairs_mut() + .append_pair("includeStatuses", &include_statuses.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commitsbatch", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2521,9 +2971,7 @@ pub mod commits { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2535,42 +2983,24 @@ pub mod commits { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(include_statuses) = &this.include_statuses { - req.url_mut() - .query_pairs_mut() - .append_pair("includeStatuses", &include_statuses.to_string()); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commitsbatch", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2716,8 +3146,12 @@ pub mod items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) path: String, @@ -2735,7 +3169,7 @@ pub mod items { pub(crate) resolve_lfs: Option, pub(crate) sanitize: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The path scope. The default is null."] pub fn scope_path(mut self, scope_path: impl Into) -> Self { self.scope_path = Some(scope_path.into()); @@ -2809,6 +3243,106 @@ pub mod items { self.sanitize = Some(sanitize); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let path = &this.path; + req.url_mut().query_pairs_mut().append_pair("path", path); + if let Some(scope_path) = &this.scope_path { + req.url_mut() + .query_pairs_mut() + .append_pair("scopePath", scope_path); + } + if let Some(recursion_level) = &this.recursion_level { + req.url_mut() + .query_pairs_mut() + .append_pair("recursionLevel", &recursion_level.to_string()); + } + if let Some(include_content_metadata) = &this.include_content_metadata { + req.url_mut().query_pairs_mut().append_pair( + "includeContentMetadata", + &include_content_metadata.to_string(), + ); + } + if let Some(latest_processed_change) = &this.latest_processed_change { + req.url_mut().query_pairs_mut().append_pair( + "latestProcessedChange", + &latest_processed_change.to_string(), + ); + } + if let Some(download) = &this.download { + req.url_mut() + .query_pairs_mut() + .append_pair("download", &download.to_string()); + } + if let Some(format) = &this.format { + req.url_mut() + .query_pairs_mut() + .append_pair("$format", format); + } + if let Some(version_descriptor_version) = &this.version_descriptor_version { + req.url_mut() + .query_pairs_mut() + .append_pair("versionDescriptor.version", version_descriptor_version); + } + if let Some(version_descriptor_version_options) = + &this.version_descriptor_version_options + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionOptions", + &version_descriptor_version_options.to_string(), + ); + } + if let Some(version_descriptor_version_type) = &this.version_descriptor_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionType", + &version_descriptor_version_type.to_string(), + ); + } + if let Some(include_content) = &this.include_content { + req.url_mut() + .query_pairs_mut() + .append_pair("includeContent", &include_content.to_string()); + } + if let Some(resolve_lfs) = &this.resolve_lfs { + req.url_mut() + .query_pairs_mut() + .append_pair("resolveLfs", &resolve_lfs.to_string()); + } + if let Some(sanitize) = &this.sanitize { + req.url_mut() + .query_pairs_mut() + .append_pair("sanitize", &sanitize.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/items?path={}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.path + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2817,9 +3351,7 @@ pub mod items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2831,98 +3363,24 @@ pub mod items { auth_header, ); } - let path = &this.path; - req.url_mut().query_pairs_mut().append_pair("path", path); - if let Some(scope_path) = &this.scope_path { - req.url_mut() - .query_pairs_mut() - .append_pair("scopePath", scope_path); - } - if let Some(recursion_level) = &this.recursion_level { - req.url_mut() - .query_pairs_mut() - .append_pair("recursionLevel", &recursion_level.to_string()); - } - if let Some(include_content_metadata) = &this.include_content_metadata { - req.url_mut().query_pairs_mut().append_pair( - "includeContentMetadata", - &include_content_metadata.to_string(), - ); - } - if let Some(latest_processed_change) = &this.latest_processed_change { - req.url_mut().query_pairs_mut().append_pair( - "latestProcessedChange", - &latest_processed_change.to_string(), - ); - } - if let Some(download) = &this.download { - req.url_mut() - .query_pairs_mut() - .append_pair("download", &download.to_string()); - } - if let Some(format) = &this.format { - req.url_mut() - .query_pairs_mut() - .append_pair("$format", format); - } - if let Some(version_descriptor_version) = &this.version_descriptor_version { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.version", - version_descriptor_version, - ); - } - if let Some(version_descriptor_version_options) = - &this.version_descriptor_version_options - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionOptions", - &version_descriptor_version_options.to_string(), - ); - } - if let Some(version_descriptor_version_type) = - &this.version_descriptor_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionType", - &version_descriptor_version_type.to_string(), - ); - } - if let Some(include_content) = &this.include_content { - req.url_mut() - .query_pairs_mut() - .append_pair("includeContent", &include_content.to_string()); - } - if let Some(resolve_lfs) = &this.resolve_lfs { - req.url_mut() - .query_pairs_mut() - .append_pair("resolveLfs", &resolve_lfs.to_string()); - } - if let Some(sanitize) = &this.sanitize { - req.url_mut() - .query_pairs_mut() - .append_pair("sanitize", &sanitize.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/items?path={}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.path - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2972,8 +3430,12 @@ pub mod items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) project: String, @@ -2989,7 +3451,7 @@ pub mod items { pub(crate) version_descriptor_version_type: Option, pub(crate) zip_for_unix: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The path scope. The default is null."] pub fn scope_path(mut self, scope_path: impl Into) -> Self { self.scope_path = Some(scope_path.into()); @@ -3058,6 +3520,98 @@ pub mod items { self.zip_for_unix = Some(zip_for_unix); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(scope_path) = &this.scope_path { + req.url_mut() + .query_pairs_mut() + .append_pair("scopePath", scope_path); + } + if let Some(recursion_level) = &this.recursion_level { + req.url_mut() + .query_pairs_mut() + .append_pair("recursionLevel", &recursion_level.to_string()); + } + if let Some(include_content_metadata) = &this.include_content_metadata { + req.url_mut().query_pairs_mut().append_pair( + "includeContentMetadata", + &include_content_metadata.to_string(), + ); + } + if let Some(latest_processed_change) = &this.latest_processed_change { + req.url_mut().query_pairs_mut().append_pair( + "latestProcessedChange", + &latest_processed_change.to_string(), + ); + } + if let Some(download) = &this.download { + req.url_mut() + .query_pairs_mut() + .append_pair("download", &download.to_string()); + } + if let Some(include_links) = &this.include_links { + req.url_mut() + .query_pairs_mut() + .append_pair("includeLinks", &include_links.to_string()); + } + if let Some(format) = &this.format { + req.url_mut() + .query_pairs_mut() + .append_pair("$format", format); + } + if let Some(version_descriptor_version) = &this.version_descriptor_version { + req.url_mut() + .query_pairs_mut() + .append_pair("versionDescriptor.version", version_descriptor_version); + } + if let Some(version_descriptor_version_options) = + &this.version_descriptor_version_options + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionOptions", + &version_descriptor_version_options.to_string(), + ); + } + if let Some(version_descriptor_version_type) = &this.version_descriptor_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionType", + &version_descriptor_version_type.to_string(), + ); + } + if let Some(zip_for_unix) = &this.zip_for_unix { + req.url_mut() + .query_pairs_mut() + .append_pair("zipForUnix", &zip_for_unix.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/items", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3066,9 +3620,7 @@ pub mod items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3080,90 +3632,24 @@ pub mod items { auth_header, ); } - if let Some(scope_path) = &this.scope_path { - req.url_mut() - .query_pairs_mut() - .append_pair("scopePath", scope_path); - } - if let Some(recursion_level) = &this.recursion_level { - req.url_mut() - .query_pairs_mut() - .append_pair("recursionLevel", &recursion_level.to_string()); - } - if let Some(include_content_metadata) = &this.include_content_metadata { - req.url_mut().query_pairs_mut().append_pair( - "includeContentMetadata", - &include_content_metadata.to_string(), - ); - } - if let Some(latest_processed_change) = &this.latest_processed_change { - req.url_mut().query_pairs_mut().append_pair( - "latestProcessedChange", - &latest_processed_change.to_string(), - ); - } - if let Some(download) = &this.download { - req.url_mut() - .query_pairs_mut() - .append_pair("download", &download.to_string()); - } - if let Some(include_links) = &this.include_links { - req.url_mut() - .query_pairs_mut() - .append_pair("includeLinks", &include_links.to_string()); - } - if let Some(format) = &this.format { - req.url_mut() - .query_pairs_mut() - .append_pair("$format", format); - } - if let Some(version_descriptor_version) = &this.version_descriptor_version { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.version", - version_descriptor_version, - ); - } - if let Some(version_descriptor_version_options) = - &this.version_descriptor_version_options - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionOptions", - &version_descriptor_version_options.to_string(), - ); - } - if let Some(version_descriptor_version_type) = - &this.version_descriptor_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionType", - &version_descriptor_version_type.to_string(), - ); - } - if let Some(zip_for_unix) = &this.zip_for_unix { - req.url_mut() - .query_pairs_mut() - .append_pair("zipForUnix", &zip_for_unix.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/items", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3213,25 +3699,57 @@ pub mod items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitItemRequestData, pub(crate) repository_id: String, pub(crate) project: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/itemsbatch", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3243,27 +3761,24 @@ pub mod items { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/itemsbatch", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3370,8 +3885,12 @@ pub mod stats { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) name: String, @@ -3380,7 +3899,7 @@ pub mod stats { pub(crate) base_version_descriptor_version_options: Option, pub(crate) base_version_descriptor_version_type: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] pub fn base_version_descriptor_version( mut self, @@ -3407,6 +3926,62 @@ pub mod stats { Some(base_version_descriptor_version_type.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let name = &this.name; + req.url_mut().query_pairs_mut().append_pair("name", name); + if let Some(base_version_descriptor_version) = &this.base_version_descriptor_version + { + req.url_mut().query_pairs_mut().append_pair( + "baseVersionDescriptor.version", + base_version_descriptor_version, + ); + } + if let Some(base_version_descriptor_version_options) = + &this.base_version_descriptor_version_options + { + req.url_mut().query_pairs_mut().append_pair( + "baseVersionDescriptor.versionOptions", + &base_version_descriptor_version_options.to_string(), + ); + } + if let Some(base_version_descriptor_version_type) = + &this.base_version_descriptor_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "baseVersionDescriptor.versionType", + &base_version_descriptor_version_type.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/stats/branches?name={}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3415,9 +3990,7 @@ pub mod stats { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3429,53 +4002,24 @@ pub mod stats { auth_header, ); } - let name = &this.name; - req.url_mut().query_pairs_mut().append_pair("name", name); - if let Some(base_version_descriptor_version) = - &this.base_version_descriptor_version - { - req.url_mut().query_pairs_mut().append_pair( - "baseVersionDescriptor.version", - base_version_descriptor_version, - ); - } - if let Some(base_version_descriptor_version_options) = - &this.base_version_descriptor_version_options - { - req.url_mut().query_pairs_mut().append_pair( - "baseVersionDescriptor.versionOptions", - &base_version_descriptor_version_options.to_string(), - ); - } - if let Some(base_version_descriptor_version_type) = - &this.base_version_descriptor_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "baseVersionDescriptor.versionType", - &base_version_descriptor_version_type.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/stats/branches?name={}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3525,8 +4069,12 @@ pub mod stats { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) project: String, @@ -3534,7 +4082,7 @@ pub mod stats { pub(crate) base_version_descriptor_version_options: Option, pub(crate) base_version_descriptor_version_type: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] pub fn base_version_descriptor_version( mut self, @@ -3561,6 +4109,59 @@ pub mod stats { Some(base_version_descriptor_version_type.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(base_version_descriptor_version) = &this.base_version_descriptor_version + { + req.url_mut().query_pairs_mut().append_pair( + "baseVersionDescriptor.version", + base_version_descriptor_version, + ); + } + if let Some(base_version_descriptor_version_options) = + &this.base_version_descriptor_version_options + { + req.url_mut().query_pairs_mut().append_pair( + "baseVersionDescriptor.versionOptions", + &base_version_descriptor_version_options.to_string(), + ); + } + if let Some(base_version_descriptor_version_type) = + &this.base_version_descriptor_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "baseVersionDescriptor.versionType", + &base_version_descriptor_version_type.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/stats/branches", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3569,9 +4170,7 @@ pub mod stats { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3583,50 +4182,24 @@ pub mod stats { auth_header, ); } - if let Some(base_version_descriptor_version) = - &this.base_version_descriptor_version - { - req.url_mut().query_pairs_mut().append_pair( - "baseVersionDescriptor.version", - base_version_descriptor_version, - ); - } - if let Some(base_version_descriptor_version_options) = - &this.base_version_descriptor_version_options - { - req.url_mut().query_pairs_mut().append_pair( - "baseVersionDescriptor.versionOptions", - &base_version_descriptor_version_options.to_string(), - ); - } - if let Some(base_version_descriptor_version_type) = - &this.base_version_descriptor_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "baseVersionDescriptor.versionType", - &base_version_descriptor_version_type.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/stats/branches", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3761,14 +4334,18 @@ pub mod refs_favorites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) repository_id: Option, pub(crate) identity_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The id of the repository."] pub fn repository_id(mut self, repository_id: impl Into) -> Self { self.repository_id = Some(repository_id.into()); @@ -3779,6 +4356,45 @@ pub mod refs_favorites { self.identity_id = Some(identity_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(repository_id) = &this.repository_id { + req.url_mut() + .query_pairs_mut() + .append_pair("repositoryId", repository_id); + } + if let Some(identity_id) = &this.identity_id { + req.url_mut() + .query_pairs_mut() + .append_pair("identityId", identity_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/favorites/refs", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3787,9 +4403,7 @@ pub mod refs_favorites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3801,35 +4415,24 @@ pub mod refs_favorites { auth_header, ); } - if let Some(repository_id) = &this.repository_id { - req.url_mut() - .query_pairs_mut() - .append_pair("repositoryId", repository_id); - } - if let Some(identity_id) = &this.identity_id { - req.url_mut() - .query_pairs_mut() - .append_pair("identityId", identity_id); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/favorites/refs", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3879,12 +4482,45 @@ pub mod refs_favorites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitRefFavorite, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/favorites/refs", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3894,9 +4530,7 @@ pub mod refs_favorites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3908,26 +4542,24 @@ pub mod refs_favorites { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/favorites/refs", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3977,12 +4609,45 @@ pub mod refs_favorites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) favorite_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/favorites/refs/{}", + self.client.endpoint(), + self.organization, + self.project, + self.favorite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3992,9 +4657,7 @@ pub mod refs_favorites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4006,26 +4669,24 @@ pub mod refs_favorites { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/favorites/refs/{}", - self.client.endpoint(), - self.organization, - self.project, - self.favorite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4070,40 +4731,28 @@ pub mod refs_favorites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) favorite_id: i32, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -4121,6 +4770,47 @@ pub mod refs_favorites { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result<()>; type IntoFuture = BoxFuture<'static, azure_core::Result<()>>; @@ -4217,8 +4907,12 @@ pub mod policy_configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) repository_id: Option, @@ -4227,7 +4921,7 @@ pub mod policy_configurations { pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The repository id."] pub fn repository_id(mut self, repository_id: impl Into) -> Self { self.repository_id = Some(repository_id.into()); @@ -4253,6 +4947,60 @@ pub mod policy_configurations { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(repository_id) = &this.repository_id { + req.url_mut() + .query_pairs_mut() + .append_pair("repositoryId", repository_id); + } + if let Some(ref_name) = &this.ref_name { + req.url_mut() + .query_pairs_mut() + .append_pair("refName", ref_name); + } + if let Some(policy_type) = &this.policy_type { + req.url_mut() + .query_pairs_mut() + .append_pair("policyType", policy_type); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/policy/configurations", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4261,9 +5009,7 @@ pub mod policy_configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4275,50 +5021,24 @@ pub mod policy_configurations { auth_header, ); } - if let Some(repository_id) = &this.repository_id { - req.url_mut() - .query_pairs_mut() - .append_pair("repositoryId", repository_id); - } - if let Some(ref_name) = &this.ref_name { - req.url_mut() - .query_pairs_mut() - .append_pair("refName", ref_name); - } - if let Some(policy_type) = &this.policy_type { - req.url_mut() - .query_pairs_mut() - .append_pair("policyType", policy_type); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/policy/configurations", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4538,8 +5258,12 @@ pub mod pull_requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) search_criteria_creator_id: Option, @@ -4558,7 +5282,7 @@ pub mod pull_requests { pub(crate) skip: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If set, search for pull requests that were created by this identity."] pub fn search_criteria_creator_id( mut self, @@ -4664,6 +5388,120 @@ pub mod pull_requests { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(search_criteria_creator_id) = &this.search_criteria_creator_id { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.creatorId", search_criteria_creator_id); + } + if let Some(search_criteria_include_links) = &this.search_criteria_include_links { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.includeLinks", + &search_criteria_include_links.to_string(), + ); + } + if let Some(search_criteria_max_time) = &this.search_criteria_max_time { + 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 { + 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 + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.queryTimeRangeType", + &search_criteria_query_time_range_type.to_string(), + ); + } + if let Some(search_criteria_repository_id) = &this.search_criteria_repository_id { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.repositoryId", search_criteria_repository_id); + } + if let Some(search_criteria_reviewer_id) = &this.search_criteria_reviewer_id { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.reviewerId", search_criteria_reviewer_id); + } + if let Some(search_criteria_source_ref_name) = &this.search_criteria_source_ref_name + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.sourceRefName", + search_criteria_source_ref_name, + ); + } + if let Some(search_criteria_source_repository_id) = + &this.search_criteria_source_repository_id + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.sourceRepositoryId", + search_criteria_source_repository_id, + ); + } + if let Some(search_criteria_status) = &this.search_criteria_status { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.status", &search_criteria_status.to_string()); + } + if let Some(search_criteria_target_ref_name) = &this.search_criteria_target_ref_name + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.targetRefName", + search_criteria_target_ref_name, + ); + } + if let Some(max_comment_length) = &this.max_comment_length { + req.url_mut() + .query_pairs_mut() + .append_pair("maxCommentLength", &max_comment_length.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/pullrequests", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4672,9 +5510,7 @@ pub mod pull_requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4686,121 +5522,24 @@ pub mod pull_requests { auth_header, ); } - if let Some(search_criteria_creator_id) = &this.search_criteria_creator_id { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.creatorId", - search_criteria_creator_id, - ); - } - if let Some(search_criteria_include_links) = - &this.search_criteria_include_links - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.includeLinks", - &search_criteria_include_links.to_string(), - ); - } - if let Some(search_criteria_max_time) = &this.search_criteria_max_time { - 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 { - 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 - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.queryTimeRangeType", - &search_criteria_query_time_range_type.to_string(), - ); - } - if let Some(search_criteria_repository_id) = - &this.search_criteria_repository_id - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.repositoryId", - search_criteria_repository_id, - ); - } - if let Some(search_criteria_reviewer_id) = &this.search_criteria_reviewer_id - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.reviewerId", - search_criteria_reviewer_id, - ); - } - if let Some(search_criteria_source_ref_name) = - &this.search_criteria_source_ref_name - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.sourceRefName", - search_criteria_source_ref_name, - ); - } - if let Some(search_criteria_source_repository_id) = - &this.search_criteria_source_repository_id - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.sourceRepositoryId", - search_criteria_source_repository_id, - ); - } - if let Some(search_criteria_status) = &this.search_criteria_status { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.status", - &search_criteria_status.to_string(), - ); - } - if let Some(search_criteria_target_ref_name) = - &this.search_criteria_target_ref_name - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.targetRefName", - search_criteria_target_ref_name, - ); - } - if let Some(max_comment_length) = &this.max_comment_length { - req.url_mut() - .query_pairs_mut() - .append_pair("maxCommentLength", &max_comment_length.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/pullrequests", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4850,12 +5589,45 @@ pub mod pull_requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/pullrequests/{}", + self.client.endpoint(), + self.organization, + self.project, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4865,9 +5637,7 @@ pub mod pull_requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4879,26 +5649,24 @@ pub mod pull_requests { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/pullrequests/{}", - self.client.endpoint(), - self.organization, - self.project, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4948,8 +5716,12 @@ pub mod pull_requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) project: String, @@ -4969,7 +5741,7 @@ pub mod pull_requests { pub(crate) skip: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If set, search for pull requests that were created by this identity."] pub fn search_criteria_creator_id( mut self, @@ -5075,6 +5847,121 @@ pub mod pull_requests { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(search_criteria_creator_id) = &this.search_criteria_creator_id { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.creatorId", search_criteria_creator_id); + } + if let Some(search_criteria_include_links) = &this.search_criteria_include_links { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.includeLinks", + &search_criteria_include_links.to_string(), + ); + } + if let Some(search_criteria_max_time) = &this.search_criteria_max_time { + 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 { + 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 + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.queryTimeRangeType", + &search_criteria_query_time_range_type.to_string(), + ); + } + if let Some(search_criteria_repository_id) = &this.search_criteria_repository_id { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.repositoryId", search_criteria_repository_id); + } + if let Some(search_criteria_reviewer_id) = &this.search_criteria_reviewer_id { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.reviewerId", search_criteria_reviewer_id); + } + if let Some(search_criteria_source_ref_name) = &this.search_criteria_source_ref_name + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.sourceRefName", + search_criteria_source_ref_name, + ); + } + if let Some(search_criteria_source_repository_id) = + &this.search_criteria_source_repository_id + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.sourceRepositoryId", + search_criteria_source_repository_id, + ); + } + if let Some(search_criteria_status) = &this.search_criteria_status { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.status", &search_criteria_status.to_string()); + } + if let Some(search_criteria_target_ref_name) = &this.search_criteria_target_ref_name + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.targetRefName", + search_criteria_target_ref_name, + ); + } + if let Some(max_comment_length) = &this.max_comment_length { + req.url_mut() + .query_pairs_mut() + .append_pair("maxCommentLength", &max_comment_length.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullrequests", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5083,9 +5970,7 @@ pub mod pull_requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5097,122 +5982,24 @@ pub mod pull_requests { auth_header, ); } - if let Some(search_criteria_creator_id) = &this.search_criteria_creator_id { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.creatorId", - search_criteria_creator_id, - ); - } - if let Some(search_criteria_include_links) = - &this.search_criteria_include_links - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.includeLinks", - &search_criteria_include_links.to_string(), - ); - } - if let Some(search_criteria_max_time) = &this.search_criteria_max_time { - 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 { - 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 - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.queryTimeRangeType", - &search_criteria_query_time_range_type.to_string(), - ); - } - if let Some(search_criteria_repository_id) = - &this.search_criteria_repository_id - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.repositoryId", - search_criteria_repository_id, - ); - } - if let Some(search_criteria_reviewer_id) = &this.search_criteria_reviewer_id - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.reviewerId", - search_criteria_reviewer_id, - ); - } - if let Some(search_criteria_source_ref_name) = - &this.search_criteria_source_ref_name - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.sourceRefName", - search_criteria_source_ref_name, - ); - } - if let Some(search_criteria_source_repository_id) = - &this.search_criteria_source_repository_id - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.sourceRepositoryId", - search_criteria_source_repository_id, - ); - } - if let Some(search_criteria_status) = &this.search_criteria_status { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.status", - &search_criteria_status.to_string(), - ); - } - if let Some(search_criteria_target_ref_name) = - &this.search_criteria_target_ref_name - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.targetRefName", - search_criteria_target_ref_name, - ); - } - if let Some(max_comment_length) = &this.max_comment_length { - req.url_mut() - .query_pairs_mut() - .append_pair("maxCommentLength", &max_comment_length.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullrequests", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5262,20 +6049,60 @@ pub mod pull_requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) project: String, pub(crate) create_options: models::GitPullRequestCreateOptions, pub(crate) supports_iterations: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If true, subsequent pushes to the pull request will be individually reviewable. Set this to false for large pull requests for performance reasons if this functionality is not needed."] pub fn supports_iterations(mut self, supports_iterations: bool) -> Self { self.supports_iterations = Some(supports_iterations); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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", &supports_iterations.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullrequests", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5284,9 +6111,7 @@ pub mod pull_requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5298,33 +6123,24 @@ pub mod pull_requests { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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", - &supports_iterations.to_string(), - ); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullrequests", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5374,8 +6190,12 @@ pub mod pull_requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -5386,7 +6206,7 @@ pub mod pull_requests { pub(crate) include_commits: Option, pub(crate) include_work_item_refs: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Not used."] pub fn max_comment_length(mut self, max_comment_length: i32) -> Self { self.max_comment_length = Some(max_comment_length); @@ -5412,6 +6232,62 @@ pub mod pull_requests { self.include_work_item_refs = Some(include_work_item_refs); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(max_comment_length) = &this.max_comment_length { + req.url_mut() + .query_pairs_mut() + .append_pair("maxCommentLength", &max_comment_length.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(include_commits) = &this.include_commits { + req.url_mut() + .query_pairs_mut() + .append_pair("includeCommits", &include_commits.to_string()); + } + if let Some(include_work_item_refs) = &this.include_work_item_refs { + req.url_mut() + .query_pairs_mut() + .append_pair("includeWorkItemRefs", &include_work_item_refs.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullrequests/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5420,9 +6296,7 @@ pub mod pull_requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5434,53 +6308,24 @@ pub mod pull_requests { auth_header, ); } - if let Some(max_comment_length) = &this.max_comment_length { - req.url_mut() - .query_pairs_mut() - .append_pair("maxCommentLength", &max_comment_length.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(include_commits) = &this.include_commits { - req.url_mut() - .query_pairs_mut() - .append_pair("includeCommits", &include_commits.to_string()); - } - if let Some(include_work_item_refs) = &this.include_work_item_refs { - req.url_mut().query_pairs_mut().append_pair( - "includeWorkItemRefs", - &include_work_item_refs.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullrequests/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5530,8 +6375,12 @@ pub mod pull_requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) project: String, @@ -5540,7 +6389,7 @@ pub mod pull_requests { pub(crate) include_commits: Option, pub(crate) include_work_item_refs: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If true, the pull request will be returned with the associated commits."] pub fn include_commits(mut self, include_commits: bool) -> Self { self.include_commits = Some(include_commits); @@ -5551,6 +6400,48 @@ pub mod pull_requests { self.include_work_item_refs = Some(include_work_item_refs); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + if let Some(include_commits) = &this.include_commits { + req.url_mut() + .query_pairs_mut() + .append_pair("includeCommits", &include_commits.to_string()); + } + req.insert_header("content-type", "application/json"); + 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", &include_work_item_refs.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullrequests/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5559,9 +6450,7 @@ pub mod pull_requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5573,39 +6462,24 @@ pub mod pull_requests { auth_header, ); } - if let Some(include_commits) = &this.include_commits { - req.url_mut() - .query_pairs_mut() - .append_pair("includeCommits", &include_commits.to_string()); - } - req.insert_header("content-type", "application/json"); - 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", - &include_work_item_refs.to_string(), - ); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullrequests/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5709,13 +6583,47 @@ pub mod annotated_tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitAnnotatedTag, pub(crate) project: String, pub(crate) repository_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/annotatedtags", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5725,9 +6633,7 @@ pub mod annotated_tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5739,27 +6645,24 @@ pub mod annotated_tags { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/annotatedtags", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5809,13 +6712,47 @@ pub mod annotated_tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) repository_id: String, pub(crate) object_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/annotatedtags/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.object_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5825,9 +6762,7 @@ pub mod annotated_tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5839,27 +6774,24 @@ pub mod annotated_tags { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/annotatedtags/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.object_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5966,19 +6898,59 @@ pub mod blobs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) repository_id: String, pub(crate) project: String, pub(crate) filename: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn filename(mut self, filename: impl Into) -> Self { self.filename = Some(filename.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/blobs", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5987,9 +6959,7 @@ pub mod blobs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6001,32 +6971,24 @@ pub mod blobs { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/blobs", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6076,8 +7038,12 @@ pub mod blobs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) sha1: String, @@ -6087,7 +7053,7 @@ pub mod blobs { pub(crate) format: Option, pub(crate) resolve_lfs: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if format is zip"] pub fn download(mut self, download: bool) -> Self { self.download = Some(download); @@ -6108,17 +7074,66 @@ pub mod blobs { self.resolve_lfs = Some(resolve_lfs); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(download) = &this.download { + req.url_mut() + .query_pairs_mut() + .append_pair("download", &download.to_string()); + } + if let Some(file_name) = &this.file_name { + req.url_mut() + .query_pairs_mut() + .append_pair("fileName", file_name); + } + if let Some(format) = &this.format { + req.url_mut() + .query_pairs_mut() + .append_pair("$format", format); + } + if let Some(resolve_lfs) = &this.resolve_lfs { + req.url_mut() + .query_pairs_mut() + .append_pair("resolveLfs", &resolve_lfs.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/blobs/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.sha1 + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6130,47 +7145,24 @@ pub mod blobs { auth_header, ); } - if let Some(download) = &this.download { - req.url_mut() - .query_pairs_mut() - .append_pair("download", &download.to_string()); - } - if let Some(file_name) = &this.file_name { - req.url_mut() - .query_pairs_mut() - .append_pair("fileName", file_name); - } - if let Some(format) = &this.format { - req.url_mut() - .query_pairs_mut() - .append_pair("$format", format); - } - if let Some(resolve_lfs) = &this.resolve_lfs { - req.url_mut() - .query_pairs_mut() - .append_pair("resolveLfs", &resolve_lfs.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/blobs/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.sha1 - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6295,13 +7287,50 @@ pub mod cherry_picks { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) repository_id: String, pub(crate) ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let ref_name = &this.ref_name; + req.url_mut() + .query_pairs_mut() + .append_pair("refName", ref_name); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/cherryPicks", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6311,9 +7340,7 @@ pub mod cherry_picks { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6325,30 +7352,24 @@ pub mod cherry_picks { auth_header, ); } - let ref_name = &this.ref_name; - req.url_mut() - .query_pairs_mut() - .append_pair("refName", ref_name); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/cherryPicks", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6398,13 +7419,47 @@ pub mod cherry_picks { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitAsyncRefOperationParameters, pub(crate) project: String, pub(crate) repository_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/cherryPicks", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6414,9 +7469,7 @@ pub mod cherry_picks { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6428,27 +7481,24 @@ pub mod cherry_picks { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/cherryPicks", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6498,13 +7548,47 @@ pub mod cherry_picks { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) cherry_pick_id: i32, pub(crate) repository_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/cherryPicks/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.cherry_pick_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6514,9 +7598,7 @@ pub mod cherry_picks { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6528,27 +7610,24 @@ pub mod cherry_picks { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/cherryPicks/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.cherry_pick_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6658,8 +7737,12 @@ pub mod statuses { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) commit_id: String, pub(crate) repository_id: String, @@ -6668,7 +7751,7 @@ pub mod statuses { pub(crate) skip: Option, pub(crate) latest_only: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Optional. The number of statuses to retrieve. Default is 1000."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -6684,6 +7767,52 @@ pub mod statuses { self.latest_only = Some(latest_only); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("skip", &skip.to_string()); + } + if let Some(latest_only) = &this.latest_only { + req.url_mut() + .query_pairs_mut() + .append_pair("latestOnly", &latest_only.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commits/{}/statuses", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.commit_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6692,9 +7821,7 @@ pub mod statuses { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6706,42 +7833,24 @@ pub mod statuses { auth_header, ); } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("skip", &skip.to_string()); - } - if let Some(latest_only) = &this.latest_only { - req.url_mut() - .query_pairs_mut() - .append_pair("latestOnly", &latest_only.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commits/{}/statuses", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.commit_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6791,14 +7900,49 @@ pub mod statuses { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitStatus, pub(crate) commit_id: String, pub(crate) repository_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commits/{}/statuses", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.commit_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6808,9 +7952,7 @@ pub mod statuses { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6822,28 +7964,24 @@ pub mod statuses { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commits/{}/statuses", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.commit_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6931,8 +8069,12 @@ pub mod diffs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) project: String, @@ -6946,7 +8088,7 @@ pub mod diffs { pub(crate) target_version_options: Option, pub(crate) target_version_type: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If true, diff between common and target commits. If false, diff between base and target commits."] pub fn diff_common_commit(mut self, diff_common_commit: bool) -> Self { self.diff_common_commit = Some(diff_common_commit); @@ -7004,80 +8146,63 @@ pub mod diffs { self.target_version_type = Some(target_version_type.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - if let Some(diff_common_commit) = &this.diff_common_commit { - req.url_mut() - .query_pairs_mut() - .append_pair("diffCommonCommit", &diff_common_commit.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(base_version) = &this.base_version { - req.url_mut() - .query_pairs_mut() - .append_pair("baseVersion", base_version); - } - if let Some(base_version_options) = &this.base_version_options { - req.url_mut().query_pairs_mut().append_pair( - "baseVersionOptions", - &base_version_options.to_string(), - ); - } - if let Some(base_version_type) = &this.base_version_type { - req.url_mut() - .query_pairs_mut() - .append_pair("baseVersionType", &base_version_type.to_string()); - } - if let Some(target_version) = &this.target_version { - req.url_mut() - .query_pairs_mut() - .append_pair("targetVersion", target_version); - } - if let Some(target_version_options) = &this.target_version_options { - req.url_mut().query_pairs_mut().append_pair( - "targetVersionOptions", - &target_version_options.to_string(), - ); - } - if let Some(target_version_type) = &this.target_version_type { - req.url_mut() - .query_pairs_mut() - .append_pair("targetVersionType", &target_version_type.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(diff_common_commit) = &this.diff_common_commit { + req.url_mut() + .query_pairs_mut() + .append_pair("diffCommonCommit", &diff_common_commit.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(base_version) = &this.base_version { + req.url_mut() + .query_pairs_mut() + .append_pair("baseVersion", base_version); + } + if let Some(base_version_options) = &this.base_version_options { + req.url_mut() + .query_pairs_mut() + .append_pair("baseVersionOptions", &base_version_options.to_string()); + } + if let Some(base_version_type) = &this.base_version_type { + req.url_mut() + .query_pairs_mut() + .append_pair("baseVersionType", &base_version_type.to_string()); + } + if let Some(target_version) = &this.target_version { + req.url_mut() + .query_pairs_mut() + .append_pair("targetVersion", target_version); + } + if let Some(target_version_options) = &this.target_version_options { + req.url_mut() + .query_pairs_mut() + .append_pair("targetVersionOptions", &target_version_options.to_string()); + } + if let Some(target_version_type) = &this.target_version_type { + req.url_mut() + .query_pairs_mut() + .append_pair("targetVersionType", &target_version_type.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -7095,6 +8220,47 @@ pub mod diffs { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -7241,19 +8407,58 @@ pub mod import_requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) repository_id: String, pub(crate) include_abandoned: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to include abandoned import requests in the results."] pub fn include_abandoned(mut self, include_abandoned: bool) -> Self { self.include_abandoned = Some(include_abandoned); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/importRequests", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7262,9 +8467,7 @@ pub mod import_requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7276,31 +8479,24 @@ pub mod import_requests { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/importRequests", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7350,13 +8546,47 @@ pub mod import_requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitImportRequest, pub(crate) project: String, pub(crate) repository_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/importRequests", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7366,9 +8596,7 @@ pub mod import_requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7380,27 +8608,24 @@ pub mod import_requests { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/importRequests", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7450,13 +8675,47 @@ pub mod import_requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) repository_id: String, pub(crate) import_request_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/importRequests/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.import_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7466,9 +8725,7 @@ pub mod import_requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7480,27 +8737,24 @@ pub mod import_requests { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/importRequests/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.import_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7550,14 +8804,49 @@ pub mod import_requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitImportRequest, pub(crate) project: String, pub(crate) repository_id: String, pub(crate) import_request_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/importRequests/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.import_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7567,9 +8856,7 @@ pub mod import_requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7581,28 +8868,24 @@ pub mod import_requests { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/importRequests/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.import_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7684,13 +8967,47 @@ pub mod pull_request_query { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitPullRequestQuery, pub(crate) repository_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullrequestquery", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7700,9 +9017,7 @@ pub mod pull_request_query { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7714,27 +9029,24 @@ pub mod pull_request_query { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullrequestquery", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7894,13 +9206,47 @@ pub mod pull_request_attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7910,9 +9256,7 @@ pub mod pull_request_attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7924,27 +9268,24 @@ pub mod pull_request_attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7992,16 +9333,51 @@ pub mod pull_request_attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) file_name: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.file_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] #[doc = "However, this function can provide more flexibility when required."] @@ -8009,9 +9385,7 @@ pub mod pull_request_attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8023,28 +9397,24 @@ pub mod pull_request_attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.file_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8094,8 +9464,12 @@ pub mod pull_request_attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: String, pub(crate) file_name: String, @@ -8103,6 +9477,38 @@ pub mod pull_request_attachments { pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/octet-stream"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.file_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8112,9 +9518,7 @@ pub mod pull_request_attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8126,29 +9530,24 @@ pub mod pull_request_attachments { auth_header, ); } - req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.file_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8193,14 +9592,49 @@ pub mod pull_request_attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) file_name: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.file_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8210,9 +9644,7 @@ pub mod pull_request_attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8224,28 +9656,24 @@ pub mod pull_request_attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/attachments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.file_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8359,8 +9787,12 @@ pub mod pull_request_commits { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -8368,7 +9800,7 @@ pub mod pull_request_commits { pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Maximum number of commits to return."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -8379,6 +9811,47 @@ pub mod pull_request_commits { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/commits", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8387,9 +9860,7 @@ pub mod pull_request_commits { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8401,37 +9872,24 @@ pub mod pull_request_commits { auth_header, ); } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/commits", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8481,8 +9939,12 @@ pub mod pull_request_commits { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -8491,7 +9953,7 @@ pub mod pull_request_commits { pub(crate) top: Option, pub(crate) skip: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Maximum number of commits to return. The maximum number of commits that can be returned per batch is 500."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -8502,6 +9964,48 @@ pub mod pull_request_commits { self.skip = Some(skip); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("skip", &skip.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/commits", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8510,9 +10014,7 @@ pub mod pull_request_commits { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8524,38 +10026,24 @@ pub mod pull_request_commits { auth_header, ); } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("skip", &skip.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/commits", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8666,20 +10154,60 @@ pub mod pull_request_iterations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, pub(crate) include_commits: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If true, include the commits associated with each iteration in the response."] pub fn include_commits(mut self, include_commits: bool) -> Self { self.include_commits = Some(include_commits); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8688,9 +10216,7 @@ pub mod pull_request_iterations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8702,32 +10228,24 @@ pub mod pull_request_iterations { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8781,42 +10299,30 @@ pub mod pull_request_iterations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) iteration_id: i32, pub(crate) project: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -8836,6 +10342,47 @@ pub mod pull_request_iterations { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = @@ -8925,8 +10472,12 @@ pub mod pull_request_iteration_changes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -8936,7 +10487,7 @@ pub mod pull_request_iteration_changes { pub(crate) skip: Option, pub(crate) compare_to: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Optional. The number of changes to retrieve. The default value is 100 and the maximum value is 2000."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -8952,6 +10503,53 @@ pub mod pull_request_iteration_changes { self.compare_to = Some(compare_to); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(compare_to) = &this.compare_to { + req.url_mut() + .query_pairs_mut() + .append_pair("$compareTo", &compare_to.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/changes", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8960,9 +10558,7 @@ pub mod pull_request_iteration_changes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8974,43 +10570,24 @@ pub mod pull_request_iteration_changes { auth_header, ); } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(compare_to) = &this.compare_to { - req.url_mut() - .query_pairs_mut() - .append_pair("$compareTo", &compare_to.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/changes", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9211,14 +10788,49 @@ pub mod pull_request_iteration_statuses { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) iteration_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9228,9 +10840,7 @@ pub mod pull_request_iteration_statuses { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9242,28 +10852,24 @@ pub mod pull_request_iteration_statuses { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9314,8 +10920,12 @@ pub mod pull_request_iteration_statuses { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitPullRequestStatus, pub(crate) repository_id: String, @@ -9323,6 +10933,38 @@ pub mod pull_request_iteration_statuses { pub(crate) iteration_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9332,9 +10974,7 @@ pub mod pull_request_iteration_statuses { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9346,29 +10986,24 @@ pub mod pull_request_iteration_statuses { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9413,8 +11048,12 @@ pub mod pull_request_iteration_statuses { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::JsonPatchDocument, pub(crate) repository_id: String, @@ -9422,6 +11061,38 @@ pub mod pull_request_iteration_statuses { pub(crate) iteration_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9431,9 +11102,7 @@ pub mod pull_request_iteration_statuses { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9445,29 +11114,24 @@ pub mod pull_request_iteration_statuses { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9520,8 +11184,12 @@ pub mod pull_request_iteration_statuses { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -9529,6 +11197,38 @@ pub mod pull_request_iteration_statuses { pub(crate) status_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.iteration_id, + self.status_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9538,9 +11238,7 @@ pub mod pull_request_iteration_statuses { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9552,29 +11250,24 @@ pub mod pull_request_iteration_statuses { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.iteration_id, - self.status_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9619,8 +11312,12 @@ pub mod pull_request_iteration_statuses { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -9628,6 +11325,38 @@ pub mod pull_request_iteration_statuses { pub(crate) status_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.iteration_id, + self.status_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9637,9 +11366,7 @@ pub mod pull_request_iteration_statuses { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9651,29 +11378,24 @@ pub mod pull_request_iteration_statuses { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/iterations/{}/statuses/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.iteration_id, - self.status_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9840,20 +11562,60 @@ pub mod pull_request_labels { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, pub(crate) project_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Project ID or project name."] pub fn project_id(mut self, project_id: impl Into) -> Self { self.project_id = Some(project_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(project_id) = &this.project_id { + req.url_mut() + .query_pairs_mut() + .append_pair("projectId", project_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -9862,9 +11624,7 @@ pub mod pull_request_labels { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9876,32 +11636,24 @@ pub mod pull_request_labels { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9952,8 +11704,12 @@ pub mod pull_request_labels { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WebApiCreateTagRequestData, pub(crate) repository_id: String, @@ -9961,12 +11717,49 @@ pub mod pull_request_labels { pub(crate) project: String, pub(crate) project_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Project ID or project name."] pub fn project_id(mut self, project_id: impl Into) -> Self { self.project_id = Some(project_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -9975,9 +11768,7 @@ pub mod pull_request_labels { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9989,33 +11780,24 @@ pub mod pull_request_labels { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10065,8 +11847,12 @@ pub mod pull_request_labels { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -10074,12 +11860,49 @@ pub mod pull_request_labels { pub(crate) project: String, pub(crate) project_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Project ID or project name."] pub fn project_id(mut self, project_id: impl Into) -> Self { self.project_id = Some(project_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(project_id) = &this.project_id { + req.url_mut() + .query_pairs_mut() + .append_pair("projectId", project_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.label_id_or_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -10088,9 +11911,7 @@ pub mod pull_request_labels { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10102,33 +11923,24 @@ pub mod pull_request_labels { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.label_id_or_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10173,8 +11985,12 @@ pub mod pull_request_labels { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -10182,12 +11998,49 @@ pub mod pull_request_labels { pub(crate) project: String, pub(crate) project_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Project ID or project name."] pub fn project_id(mut self, project_id: impl Into) -> Self { self.project_id = Some(project_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + if let Some(project_id) = &this.project_id { + req.url_mut() + .query_pairs_mut() + .append_pair("projectId", project_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.label_id_or_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -10196,9 +12049,7 @@ pub mod pull_request_labels { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10210,33 +12061,24 @@ pub mod pull_request_labels { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/labels/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.label_id_or_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10346,13 +12188,47 @@ pub mod pull_request_properties { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/properties", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10362,9 +12238,7 @@ pub mod pull_request_properties { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10376,27 +12250,24 @@ pub mod pull_request_properties { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/properties", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10446,14 +12317,49 @@ pub mod pull_request_properties { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::JsonPatchDocument, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/properties", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10463,9 +12369,7 @@ pub mod pull_request_properties { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10477,28 +12381,24 @@ pub mod pull_request_properties { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/properties", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10764,41 +12664,29 @@ pub mod pull_request_reviewers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -10817,6 +12705,47 @@ pub mod pull_request_reviewers { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = @@ -10868,14 +12797,49 @@ pub mod pull_request_reviewers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10885,9 +12849,7 @@ pub mod pull_request_reviewers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10899,28 +12861,24 @@ pub mod pull_request_reviewers { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10971,14 +12929,49 @@ pub mod pull_request_reviewers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::IdentityRefWithVote, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10988,9 +12981,7 @@ pub mod pull_request_reviewers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11002,28 +12993,24 @@ pub mod pull_request_reviewers { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11068,14 +13055,49 @@ pub mod pull_request_reviewers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11085,9 +13107,7 @@ pub mod pull_request_reviewers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11099,28 +13119,24 @@ pub mod pull_request_reviewers { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11173,14 +13189,49 @@ pub mod pull_request_reviewers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) reviewer_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.reviewer_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11190,9 +13241,7 @@ pub mod pull_request_reviewers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11204,28 +13253,24 @@ pub mod pull_request_reviewers { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.reviewer_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11275,8 +13320,12 @@ pub mod pull_request_reviewers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::IdentityRefWithVote, pub(crate) repository_id: String, @@ -11284,6 +13333,38 @@ pub mod pull_request_reviewers { pub(crate) reviewer_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.reviewer_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11293,9 +13374,7 @@ pub mod pull_request_reviewers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11307,29 +13386,24 @@ pub mod pull_request_reviewers { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.reviewer_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11379,8 +13453,12 @@ pub mod pull_request_reviewers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::IdentityRefWithVote, pub(crate) repository_id: String, @@ -11388,6 +13466,38 @@ pub mod pull_request_reviewers { pub(crate) reviewer_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.reviewer_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11397,9 +13507,7 @@ pub mod pull_request_reviewers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11411,29 +13519,24 @@ pub mod pull_request_reviewers { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.reviewer_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11478,14 +13581,49 @@ pub mod pull_request_reviewers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) reviewer_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.reviewer_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11495,9 +13633,7 @@ pub mod pull_request_reviewers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11509,28 +13645,24 @@ pub mod pull_request_reviewers { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/reviewers/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.reviewer_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11612,14 +13744,49 @@ pub mod pull_request_share { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ShareNotificationContext, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/share", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11629,9 +13796,7 @@ pub mod pull_request_share { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11643,28 +13808,24 @@ pub mod pull_request_share { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/share", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11852,13 +14013,47 @@ pub mod pull_request_statuses { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11868,9 +14063,7 @@ pub mod pull_request_statuses { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11882,27 +14075,24 @@ pub mod pull_request_statuses { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11953,14 +14143,49 @@ pub mod pull_request_statuses { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitPullRequestStatus, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11970,9 +14195,7 @@ pub mod pull_request_statuses { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11984,28 +14207,24 @@ pub mod pull_request_statuses { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12050,14 +14269,49 @@ pub mod pull_request_statuses { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::JsonPatchDocument, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -12067,9 +14321,7 @@ pub mod pull_request_statuses { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12081,28 +14333,24 @@ pub mod pull_request_statuses { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12155,14 +14403,49 @@ pub mod pull_request_statuses { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) status_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.status_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -12172,9 +14455,7 @@ pub mod pull_request_statuses { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12186,28 +14467,24 @@ pub mod pull_request_statuses { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.status_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12252,14 +14529,49 @@ pub mod pull_request_statuses { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) status_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.status_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -12269,9 +14581,7 @@ pub mod pull_request_statuses { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12283,28 +14593,24 @@ pub mod pull_request_statuses { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/statuses/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.status_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12474,8 +14780,12 @@ pub mod pull_request_threads { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -12483,7 +14793,7 @@ pub mod pull_request_threads { pub(crate) iteration: Option, pub(crate) base_iteration: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If specified, thread positions will be tracked using this iteration as the right side of the diff."] pub fn iteration(mut self, iteration: i32) -> Self { self.iteration = Some(iteration); @@ -12494,17 +14804,56 @@ pub mod pull_request_threads { self.base_iteration = Some(base_iteration); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(iteration) = &this.iteration { + req.url_mut() + .query_pairs_mut() + .append_pair("$iteration", &iteration.to_string()); + } + if let Some(base_iteration) = &this.base_iteration { + req.url_mut() + .query_pairs_mut() + .append_pair("$baseIteration", &base_iteration.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] #[doc = "However, this function can provide more flexibility when required."] pub fn send(self) -> BoxFuture<'static, azure_core::Result> { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12516,37 +14865,24 @@ pub mod pull_request_threads { auth_header, ); } - if let Some(iteration) = &this.iteration { - req.url_mut() - .query_pairs_mut() - .append_pair("$iteration", &iteration.to_string()); - } - if let Some(base_iteration) = &this.base_iteration { - req.url_mut() - .query_pairs_mut() - .append_pair("$baseIteration", &base_iteration.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12600,14 +14936,49 @@ pub mod pull_request_threads { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitPullRequestCommentThread, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -12617,9 +14988,7 @@ pub mod pull_request_threads { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12631,28 +15000,24 @@ pub mod pull_request_threads { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12706,8 +15071,12 @@ pub mod pull_request_threads { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -12716,7 +15085,7 @@ pub mod pull_request_threads { pub(crate) iteration: Option, pub(crate) base_iteration: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If specified, thread position will be tracked using this iteration as the right side of the diff."] pub fn iteration(mut self, iteration: i32) -> Self { self.iteration = Some(iteration); @@ -12727,6 +15096,48 @@ pub mod pull_request_threads { self.base_iteration = Some(base_iteration); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(iteration) = &this.iteration { + req.url_mut() + .query_pairs_mut() + .append_pair("$iteration", &iteration.to_string()); + } + if let Some(base_iteration) = &this.base_iteration { + req.url_mut() + .query_pairs_mut() + .append_pair("$baseIteration", &base_iteration.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.thread_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -12735,9 +15146,7 @@ pub mod pull_request_threads { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12749,38 +15158,24 @@ pub mod pull_request_threads { auth_header, ); } - if let Some(iteration) = &this.iteration { - req.url_mut() - .query_pairs_mut() - .append_pair("$iteration", &iteration.to_string()); - } - if let Some(base_iteration) = &this.base_iteration { - req.url_mut() - .query_pairs_mut() - .append_pair("$baseIteration", &base_iteration.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.thread_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12834,8 +15229,12 @@ pub mod pull_request_threads { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitPullRequestCommentThread, pub(crate) repository_id: String, @@ -12843,6 +15242,38 @@ pub mod pull_request_threads { pub(crate) thread_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.thread_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -12852,9 +15283,7 @@ pub mod pull_request_threads { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12866,29 +15295,24 @@ pub mod pull_request_threads { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.thread_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -13089,14 +15513,49 @@ pub mod pull_request_thread_comments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) thread_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.thread_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -13106,9 +15565,7 @@ pub mod pull_request_thread_comments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -13120,28 +15577,24 @@ pub mod pull_request_thread_comments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.thread_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -13191,8 +15644,12 @@ pub mod pull_request_thread_comments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Comment, pub(crate) repository_id: String, @@ -13200,6 +15657,38 @@ pub mod pull_request_thread_comments { pub(crate) thread_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id, + self.thread_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -13209,9 +15698,7 @@ pub mod pull_request_thread_comments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -13223,29 +15710,24 @@ pub mod pull_request_thread_comments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id, - self.thread_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -13295,8 +15777,12 @@ pub mod pull_request_thread_comments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -13304,6 +15790,38 @@ pub mod pull_request_thread_comments { pub(crate) comment_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}", + 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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -13313,9 +15831,7 @@ pub mod pull_request_thread_comments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -13327,29 +15843,24 @@ pub mod pull_request_thread_comments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}", - 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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -13399,8 +15910,12 @@ pub mod pull_request_thread_comments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Comment, pub(crate) repository_id: String, @@ -13409,6 +15924,39 @@ pub mod pull_request_thread_comments { pub(crate) comment_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}", + 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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -13418,9 +15966,7 @@ pub mod pull_request_thread_comments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -13432,30 +15978,24 @@ pub mod pull_request_thread_comments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}", - 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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -13500,8 +16040,12 @@ pub mod pull_request_thread_comments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -13509,6 +16053,38 @@ pub mod pull_request_thread_comments { pub(crate) comment_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}", + 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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -13518,9 +16094,7 @@ pub mod pull_request_thread_comments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -13532,29 +16106,24 @@ pub mod pull_request_thread_comments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/threads/{}/comments/{}", - 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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -13701,8 +16270,12 @@ pub mod pull_request_comment_likes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -13710,6 +16283,29 @@ pub mod pull_request_comment_likes { pub(crate) comment_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -13719,9 +16315,7 @@ pub mod pull_request_comment_likes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -13733,20 +16327,24 @@ pub mod pull_request_comment_likes { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -13791,8 +16389,12 @@ pub mod pull_request_comment_likes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -13800,6 +16402,30 @@ pub mod pull_request_comment_likes { pub(crate) comment_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -13809,9 +16435,7 @@ pub mod pull_request_comment_likes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -13823,21 +16447,24 @@ pub mod pull_request_comment_likes { auth_header, ); } - 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?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -13885,8 +16512,12 @@ pub mod pull_request_comment_likes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, @@ -13894,6 +16525,29 @@ pub mod pull_request_comment_likes { pub(crate) comment_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -13903,9 +16557,7 @@ pub mod pull_request_comment_likes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -13917,20 +16569,24 @@ pub mod pull_request_comment_likes { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -14015,13 +16671,47 @@ pub mod pull_request_work_items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) pull_request_id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/workitems", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.pull_request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -14031,9 +16721,7 @@ pub mod pull_request_work_items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -14045,27 +16733,24 @@ pub mod pull_request_work_items { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pullRequests/{}/workitems", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.pull_request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -14197,8 +16882,12 @@ pub mod pushes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) project: String, @@ -14211,7 +16900,7 @@ pub mod pushes { pub(crate) search_criteria_ref_name: Option, pub(crate) search_criteria_to_date: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Number of pushes to skip."] pub fn skip(mut self, skip: i32) -> Self { self.skip = Some(skip); @@ -14271,6 +16960,84 @@ pub mod pushes { self.search_criteria_to_date = Some(search_criteria_to_date.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(search_criteria_from_date) = &this.search_criteria_from_date { + 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 { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.includeLinks", + &search_criteria_include_links.to_string(), + ); + } + if let Some(search_criteria_include_ref_updates) = + &this.search_criteria_include_ref_updates + { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.includeRefUpdates", + &search_criteria_include_ref_updates.to_string(), + ); + } + if let Some(search_criteria_pusher_id) = &this.search_criteria_pusher_id { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.pusherId", search_criteria_pusher_id); + } + if let Some(search_criteria_ref_name) = &this.search_criteria_ref_name { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.refName", search_criteria_ref_name); + } + if let Some(search_criteria_to_date) = &this.search_criteria_to_date { + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pushes", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -14279,9 +17046,7 @@ pub mod pushes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -14293,76 +17058,24 @@ pub mod pushes { auth_header, ); } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(search_criteria_from_date) = &this.search_criteria_from_date { - 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 - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.includeLinks", - &search_criteria_include_links.to_string(), - ); - } - if let Some(search_criteria_include_ref_updates) = - &this.search_criteria_include_ref_updates - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.includeRefUpdates", - &search_criteria_include_ref_updates.to_string(), - ); - } - if let Some(search_criteria_pusher_id) = &this.search_criteria_pusher_id { - req.url_mut() - .query_pairs_mut() - .append_pair("searchCriteria.pusherId", search_criteria_pusher_id); - } - if let Some(search_criteria_ref_name) = &this.search_criteria_ref_name { - req.url_mut() - .query_pairs_mut() - .append_pair("searchCriteria.refName", search_criteria_ref_name); - } - if let Some(search_criteria_to_date) = &this.search_criteria_to_date { - 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pushes", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -14412,42 +17125,30 @@ pub mod pushes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitPush, pub(crate) repository_id: String, pub(crate) project: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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::http::headers::AUTHORIZATION, - auth_header, - ); - } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -14465,6 +17166,47 @@ pub mod pushes { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -14512,8 +17254,12 @@ pub mod pushes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) push_id: i32, @@ -14521,7 +17267,7 @@ pub mod pushes { pub(crate) include_commits: Option, pub(crate) include_ref_updates: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The number of commits to include in the result."] pub fn include_commits(mut self, include_commits: i32) -> Self { self.include_commits = Some(include_commits); @@ -14532,6 +17278,47 @@ pub mod pushes { self.include_ref_updates = Some(include_ref_updates); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_commits) = &this.include_commits { + req.url_mut() + .query_pairs_mut() + .append_pair("includeCommits", &include_commits.to_string()); + } + if let Some(include_ref_updates) = &this.include_ref_updates { + req.url_mut() + .query_pairs_mut() + .append_pair("includeRefUpdates", &include_ref_updates.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/pushes/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.push_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -14540,9 +17327,7 @@ pub mod pushes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -14554,37 +17339,24 @@ pub mod pushes { auth_header, ); } - if let Some(include_commits) = &this.include_commits { - req.url_mut() - .query_pairs_mut() - .append_pair("includeCommits", &include_commits.to_string()); - } - if let Some(include_ref_updates) = &this.include_ref_updates { - req.url_mut() - .query_pairs_mut() - .append_pair("includeRefUpdates", &include_ref_updates.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/pushes/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.push_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -14721,8 +17493,12 @@ pub mod refs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) project: String, @@ -14736,7 +17512,7 @@ pub mod refs { pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "\\[optional\\] A filter to apply to the refs (starts with)."] pub fn filter(mut self, filter: impl Into) -> Self { self.filter = Some(filter.into()); @@ -14782,6 +17558,81 @@ pub mod refs { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(filter) = &this.filter { + req.url_mut() + .query_pairs_mut() + .append_pair("filter", filter); + } + if let Some(include_links) = &this.include_links { + req.url_mut() + .query_pairs_mut() + .append_pair("includeLinks", &include_links.to_string()); + } + if let Some(include_statuses) = &this.include_statuses { + req.url_mut() + .query_pairs_mut() + .append_pair("includeStatuses", &include_statuses.to_string()); + } + if let Some(include_my_branches) = &this.include_my_branches { + req.url_mut() + .query_pairs_mut() + .append_pair("includeMyBranches", &include_my_branches.to_string()); + } + if let Some(latest_statuses_only) = &this.latest_statuses_only { + req.url_mut() + .query_pairs_mut() + .append_pair("latestStatusesOnly", &latest_statuses_only.to_string()); + } + if let Some(peel_tags) = &this.peel_tags { + req.url_mut() + .query_pairs_mut() + .append_pair("peelTags", &peel_tags.to_string()); + } + if let Some(filter_contains) = &this.filter_contains { + req.url_mut() + .query_pairs_mut() + .append_pair("filterContains", filter_contains); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/refs", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -14790,9 +17641,7 @@ pub mod refs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -14804,72 +17653,24 @@ pub mod refs { auth_header, ); } - if let Some(filter) = &this.filter { - req.url_mut() - .query_pairs_mut() - .append_pair("filter", filter); - } - if let Some(include_links) = &this.include_links { - req.url_mut() - .query_pairs_mut() - .append_pair("includeLinks", &include_links.to_string()); - } - if let Some(include_statuses) = &this.include_statuses { - req.url_mut() - .query_pairs_mut() - .append_pair("includeStatuses", &include_statuses.to_string()); - } - if let Some(include_my_branches) = &this.include_my_branches { - req.url_mut() - .query_pairs_mut() - .append_pair("includeMyBranches", &include_my_branches.to_string()); - } - if let Some(latest_statuses_only) = &this.latest_statuses_only { - req.url_mut().query_pairs_mut().append_pair( - "latestStatusesOnly", - &latest_statuses_only.to_string(), - ); - } - if let Some(peel_tags) = &this.peel_tags { - req.url_mut() - .query_pairs_mut() - .append_pair("peelTags", &peel_tags.to_string()); - } - if let Some(filter_contains) = &this.filter_contains { - req.url_mut() - .query_pairs_mut() - .append_pair("filterContains", filter_contains); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/refs", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -14922,20 +17723,60 @@ pub mod refs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) repository_id: String, pub(crate) project: String, pub(crate) project_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "ID or name of the team project. Optional if specifying an ID for repository."] pub fn project_id(mut self, project_id: impl Into) -> Self { self.project_id = Some(project_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/refs", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -14944,9 +17785,7 @@ pub mod refs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -14958,32 +17797,24 @@ pub mod refs { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/refs", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -15034,8 +17865,12 @@ pub mod refs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitRefUpdate, pub(crate) repository_id: String, @@ -15043,12 +17878,52 @@ pub mod refs { pub(crate) project: String, pub(crate) project_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "ID or name of the team project. Optional if specifying an ID for repository."] pub fn project_id(mut self, project_id: impl Into) -> Self { self.project_id = Some(project_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + let filter = &this.filter; + req.url_mut() + .query_pairs_mut() + .append_pair("filter", filter); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/refs", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -15057,9 +17932,7 @@ pub mod refs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -15071,36 +17944,24 @@ pub mod refs { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - let filter = &this.filter; - req.url_mut() - .query_pairs_mut() - .append_pair("filter", filter); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/refs", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -15225,13 +18086,50 @@ pub mod reverts { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) repository_id: String, pub(crate) ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let ref_name = &this.ref_name; + req.url_mut() + .query_pairs_mut() + .append_pair("refName", ref_name); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/reverts", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -15241,9 +18139,7 @@ pub mod reverts { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -15255,30 +18151,24 @@ pub mod reverts { auth_header, ); } - let ref_name = &this.ref_name; - req.url_mut() - .query_pairs_mut() - .append_pair("refName", ref_name); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/reverts", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -15328,42 +18218,30 @@ pub mod reverts { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitAsyncRefOperationParameters, pub(crate) project: String, pub(crate) repository_id: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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::http::headers::AUTHORIZATION, - auth_header, - ); - } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -15381,6 +18259,47 @@ pub mod reverts { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -15428,13 +18347,47 @@ pub mod reverts { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) revert_id: i32, pub(crate) repository_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/reverts/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.revert_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -15444,9 +18397,7 @@ pub mod reverts { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -15458,27 +18409,24 @@ pub mod reverts { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/reverts/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.revert_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -15557,12 +18505,45 @@ pub mod suggestions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/suggestions", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -15572,9 +18553,7 @@ pub mod suggestions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -15586,26 +18565,24 @@ pub mod suggestions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/suggestions", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -15691,8 +18668,12 @@ pub mod trees { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_id: String, pub(crate) sha1: String, @@ -15702,7 +18683,7 @@ pub mod trees { pub(crate) file_name: Option, pub(crate) format: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Project Id."] pub fn project_id(mut self, project_id: impl Into) -> Self { self.project_id = Some(project_id.into()); @@ -15723,6 +18704,57 @@ pub mod trees { self.format = Some(format.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(project_id) = &this.project_id { + req.url_mut() + .query_pairs_mut() + .append_pair("projectId", project_id); + } + if let Some(recursive) = &this.recursive { + req.url_mut() + .query_pairs_mut() + .append_pair("recursive", &recursive.to_string()); + } + if let Some(file_name) = &this.file_name { + req.url_mut() + .query_pairs_mut() + .append_pair("fileName", file_name); + } + if let Some(format) = &this.format { + req.url_mut() + .query_pairs_mut() + .append_pair("$format", format); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/trees/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_id, + self.sha1 + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -15731,9 +18763,7 @@ pub mod trees { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -15745,47 +18775,24 @@ pub mod trees { auth_header, ); } - if let Some(project_id) = &this.project_id { - req.url_mut() - .query_pairs_mut() - .append_pair("projectId", project_id); - } - if let Some(recursive) = &this.recursive { - req.url_mut() - .query_pairs_mut() - .append_pair("recursive", &recursive.to_string()); - } - if let Some(file_name) = &this.file_name { - req.url_mut() - .query_pairs_mut() - .append_pair("fileName", file_name); - } - if let Some(format) = &this.format { - req.url_mut() - .query_pairs_mut() - .append_pair("$format", format); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/trees/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_id, - self.sha1 - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -15872,8 +18879,12 @@ pub mod merge_bases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_name_or_id: String, pub(crate) commit_id: String, @@ -15882,7 +18893,7 @@ pub mod merge_bases { pub(crate) other_collection_id: Option, pub(crate) other_repository_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The collection ID where otherCommitId lives."] pub fn other_collection_id(mut self, other_collection_id: impl Into) -> Self { self.other_collection_id = Some(other_collection_id.into()); @@ -15893,6 +18904,51 @@ pub mod merge_bases { self.other_repository_id = Some(other_repository_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let other_commit_id = &this.other_commit_id; + req.url_mut() + .query_pairs_mut() + .append_pair("otherCommitId", other_commit_id); + if let Some(other_collection_id) = &this.other_collection_id { + req.url_mut() + .query_pairs_mut() + .append_pair("otherCollectionId", other_collection_id); + } + if let Some(other_repository_id) = &this.other_repository_id { + req.url_mut() + .query_pairs_mut() + .append_pair("otherRepositoryId", other_repository_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/commits/{}/mergebases", + self.client.endpoint(), + self.organization, + self.project, + self.repository_name_or_id, + self.commit_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -15901,9 +18957,7 @@ pub mod merge_bases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -15915,41 +18969,24 @@ pub mod merge_bases { auth_header, ); } - let other_commit_id = &this.other_commit_id; - req.url_mut() - .query_pairs_mut() - .append_pair("otherCommitId", other_commit_id); - if let Some(other_collection_id) = &this.other_collection_id { - req.url_mut() - .query_pairs_mut() - .append_pair("otherCollectionId", other_collection_id); - } - if let Some(other_repository_id) = &this.other_repository_id { - req.url_mut() - .query_pairs_mut() - .append_pair("otherRepositoryId", other_repository_id); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/commits/{}/mergebases", - self.client.endpoint(), - self.organization, - self.project, - self.repository_name_or_id, - self.commit_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -16099,20 +19136,60 @@ pub mod forks { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_name_or_id: String, pub(crate) collection_id: String, pub(crate) project: String, pub(crate) include_links: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to include links."] pub fn include_links(mut self, include_links: bool) -> Self { self.include_links = Some(include_links); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/forks/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_name_or_id, + self.collection_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -16121,9 +19198,7 @@ pub mod forks { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -16135,32 +19210,24 @@ pub mod forks { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/forks/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_name_or_id, - self.collection_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -16213,15 +19280,19 @@ pub mod forks { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_name_or_id: String, pub(crate) project: String, pub(crate) include_abandoned: Option, pub(crate) include_links: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to include abandoned requests."] pub fn include_abandoned(mut self, include_abandoned: bool) -> Self { self.include_abandoned = Some(include_abandoned); @@ -16232,43 +19303,28 @@ pub mod forks { self.include_links = Some(include_links); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - 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()); - } - 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::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_abandoned) = &this.include_abandoned { + req.url_mut() + .query_pairs_mut() + .append_pair("includeAbandoned", &include_abandoned.to_string()); + } + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -16286,6 +19342,47 @@ pub mod forks { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = @@ -16334,20 +19431,60 @@ pub mod forks { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitForkSyncRequestParameters, pub(crate) repository_name_or_id: String, pub(crate) project: String, pub(crate) include_links: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to include links"] pub fn include_links(mut self, include_links: bool) -> Self { self.include_links = Some(include_links); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/forkSyncRequests", + self.client.endpoint(), + self.organization, + self.project, + self.repository_name_or_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -16356,9 +19493,7 @@ pub mod forks { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -16370,32 +19505,24 @@ pub mod forks { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/forkSyncRequests", - self.client.endpoint(), - self.organization, - self.project, - self.repository_name_or_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -16445,20 +19572,60 @@ pub mod forks { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) repository_name_or_id: String, pub(crate) fork_sync_operation_id: i32, pub(crate) project: String, pub(crate) include_links: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to include links."] pub fn include_links(mut self, include_links: bool) -> Self { self.include_links = Some(include_links); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/forkSyncRequests/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_name_or_id, + self.fork_sync_operation_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -16467,9 +19634,7 @@ pub mod forks { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -16481,32 +19646,24 @@ pub mod forks { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/forkSyncRequests/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_name_or_id, - self.fork_sync_operation_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -16612,20 +19769,60 @@ pub mod merges { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GitMergeParameters, pub(crate) project: String, pub(crate) repository_name_or_id: String, pub(crate) include_links: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to include links"] pub fn include_links(mut self, include_links: bool) -> Self { self.include_links = Some(include_links); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/merges", + self.client.endpoint(), + self.organization, + self.project, + self.repository_name_or_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -16634,9 +19831,7 @@ pub mod merges { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -16648,32 +19843,24 @@ pub mod merges { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/merges", - self.client.endpoint(), - self.organization, - self.project, - self.repository_name_or_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -16723,20 +19910,60 @@ pub mod merges { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) repository_name_or_id: String, pub(crate) merge_operation_id: i32, pub(crate) include_links: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to true to include links"] pub fn include_links(mut self, include_links: bool) -> Self { self.include_links = Some(include_links); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/git/repositories/{}/merges/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository_name_or_id, + self.merge_operation_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -16745,9 +19972,7 @@ pub mod merges { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -16759,32 +19984,24 @@ pub mod merges { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/git/repositories/{}/merges/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository_name_or_id, - self.merge_operation_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -16801,3 +20018,2679 @@ pub mod merges { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn annotated_tags_client(&self) -> annotated_tags::Client { + annotated_tags::Client(self.clone()) + } + pub fn blobs_client(&self) -> blobs::Client { + blobs::Client(self.clone()) + } + pub fn cherry_picks_client(&self) -> cherry_picks::Client { + cherry_picks::Client(self.clone()) + } + pub fn commits_client(&self) -> commits::Client { + commits::Client(self.clone()) + } + pub fn diffs_client(&self) -> diffs::Client { + diffs::Client(self.clone()) + } + pub fn forks_client(&self) -> forks::Client { + forks::Client(self.clone()) + } + pub fn import_requests_client(&self) -> import_requests::Client { + import_requests::Client(self.clone()) + } + pub fn items_client(&self) -> items::Client { + items::Client(self.clone()) + } + pub fn merge_bases_client(&self) -> merge_bases::Client { + merge_bases::Client(self.clone()) + } + pub fn merges_client(&self) -> merges::Client { + merges::Client(self.clone()) + } + pub fn policy_configurations_client(&self) -> policy_configurations::Client { + policy_configurations::Client(self.clone()) + } + pub fn pull_request_attachments_client(&self) -> pull_request_attachments::Client { + pull_request_attachments::Client(self.clone()) + } + pub fn pull_request_comment_likes_client(&self) -> pull_request_comment_likes::Client { + pull_request_comment_likes::Client(self.clone()) + } + pub fn pull_request_commits_client(&self) -> pull_request_commits::Client { + pull_request_commits::Client(self.clone()) + } + pub fn pull_request_iteration_changes_client( + &self, + ) -> pull_request_iteration_changes::Client { + pull_request_iteration_changes::Client(self.clone()) + } + pub fn pull_request_iteration_statuses_client( + &self, + ) -> pull_request_iteration_statuses::Client { + pull_request_iteration_statuses::Client(self.clone()) + } + pub fn pull_request_iterations_client(&self) -> pull_request_iterations::Client { + pull_request_iterations::Client(self.clone()) + } + pub fn pull_request_labels_client(&self) -> pull_request_labels::Client { + pull_request_labels::Client(self.clone()) + } + pub fn pull_request_properties_client(&self) -> pull_request_properties::Client { + pull_request_properties::Client(self.clone()) + } + pub fn pull_request_query_client(&self) -> pull_request_query::Client { + pull_request_query::Client(self.clone()) + } + pub fn pull_request_reviewers_client(&self) -> pull_request_reviewers::Client { + pull_request_reviewers::Client(self.clone()) + } + pub fn pull_request_share_client(&self) -> pull_request_share::Client { + pull_request_share::Client(self.clone()) + } + pub fn pull_request_statuses_client(&self) -> pull_request_statuses::Client { + pull_request_statuses::Client(self.clone()) + } + pub fn pull_request_thread_comments_client(&self) -> pull_request_thread_comments::Client { + pull_request_thread_comments::Client(self.clone()) + } + pub fn pull_request_threads_client(&self) -> pull_request_threads::Client { + pull_request_threads::Client(self.clone()) + } + pub fn pull_request_work_items_client(&self) -> pull_request_work_items::Client { + pull_request_work_items::Client(self.clone()) + } + pub fn pull_requests_client(&self) -> pull_requests::Client { + pull_requests::Client(self.clone()) + } + pub fn pushes_client(&self) -> pushes::Client { + pushes::Client(self.clone()) + } + pub fn refs_client(&self) -> refs::Client { + refs::Client(self.clone()) + } + pub fn refs_favorites_client(&self) -> refs_favorites::Client { + refs_favorites::Client(self.clone()) + } + pub fn repositories_client(&self) -> repositories::Client { + repositories::Client(self.clone()) + } + pub fn reverts_client(&self) -> reverts::Client { + reverts::Client(self.clone()) + } + pub fn stats_client(&self) -> stats::Client { + stats::Client(self.clone()) + } + pub fn statuses_client(&self) -> statuses::Client { + statuses::Client(self.clone()) + } + pub fn suggestions_client(&self) -> suggestions::Client { + suggestions::Client(self.clone()) + } + pub fn trees_client(&self) -> trees::Client { + trees::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod repositories { + use super::super::models; + use super::super::repositories::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve a git repository."] + #[doc = ""] + #[doc = "See [`get_repository_with_parent`](super::super::repositories::Client::get_repository_with_parent) for details of the arguments."] + pub fn get_repository_with_parent( + &self, + organization: impl Into, + repository_id: impl Into, + include_parent: bool, + project: impl Into, + ) -> get_repository_with_parent::RequestBuilder { + get_repository_with_parent::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + include_parent, + project: project.into(), + } + } + #[doc = "Retrieve deleted git repositories."] + #[doc = ""] + #[doc = "See [`get_deleted_repositories`](super::super::repositories::Client::get_deleted_repositories) for details of the arguments."] + pub fn get_deleted_repositories( + &self, + organization: impl Into, + project: impl Into, + ) -> get_deleted_repositories::RequestBuilder { + get_deleted_repositories::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Retrieve soft-deleted git repositories from the recycle bin."] + #[doc = ""] + #[doc = "See [`get_recycle_bin_repositories`](super::super::repositories::Client::get_recycle_bin_repositories) for details of the arguments."] + pub fn get_recycle_bin_repositories( + &self, + organization: impl Into, + project: impl Into, + ) -> get_recycle_bin_repositories::RequestBuilder { + get_recycle_bin_repositories::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Recover a soft-deleted Git repository. Recently deleted repositories go into a soft-delete state for a period of time before they are hard deleted and become unrecoverable."] + #[doc = ""] + #[doc = "See [`restore_repository_from_recycle_bin`](super::super::repositories::Client::restore_repository_from_recycle_bin) for details of the arguments."] + pub fn restore_repository_from_recycle_bin( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + repository_id: impl Into, + ) -> restore_repository_from_recycle_bin::RequestBuilder { + restore_repository_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + repository_id: repository_id.into(), + } + } + #[doc = "Destroy (hard delete) a soft-deleted Git repository."] + #[doc = ""] + #[doc = "See [`delete_repository_from_recycle_bin`](super::super::repositories::Client::delete_repository_from_recycle_bin) for details of the arguments."] + pub fn delete_repository_from_recycle_bin( + &self, + organization: impl Into, + project: impl Into, + repository_id: impl Into, + ) -> delete_repository_from_recycle_bin::RequestBuilder { + delete_repository_from_recycle_bin::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + repository_id: repository_id.into(), + } + } + #[doc = "Retrieve git repositories."] + #[doc = ""] + #[doc = "See [`list`](super::super::repositories::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + include_links: None, + include_all_urls: None, + include_hidden: None, + } + } + #[doc = "Create a git repository in a team project."] + #[doc = ""] + #[doc = "See [`create`](super::super::repositories::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + source_ref: None, + } + } + #[doc = "Retrieve a git repository."] + #[doc = ""] + #[doc = "See [`get_repository`](super::super::repositories::Client::get_repository) for details of the arguments."] + pub fn get_repository( + &self, + organization: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> get_repository::RequestBuilder { + get_repository::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + } + } + #[doc = "Updates the Git repository with either a new repo name or a new default branch."] + #[doc = ""] + #[doc = "See [`update`](super::super::repositories::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + project: project.into(), + } + } + #[doc = "Delete a git repository"] + #[doc = ""] + #[doc = "See [`delete`](super::super::repositories::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + } + } + } + } + pub mod commits { + use super::super::commits::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve git commits for a project\n\nParameters that use the searchCriteria prefix in their name can be specified without it as query parameters, e.g. searchCriteria.$top -> $top"] + #[doc = ""] + #[doc = "See [`get_commits`](super::super::commits::Client::get_commits) for details of the arguments."] + pub fn get_commits( + &self, + organization: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> get_commits::RequestBuilder { + get_commits::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + search_criteria_skip: None, + search_criteria_top: None, + search_criteria_author: None, + search_criteria_compare_version_version: None, + search_criteria_compare_version_version_options: None, + search_criteria_compare_version_version_type: None, + search_criteria_exclude_deletes: None, + search_criteria_from_commit_id: None, + search_criteria_from_date: None, + search_criteria_history_mode: None, + search_criteria_ids: Vec::new(), + search_criteria_include_links: None, + search_criteria_include_push_data: None, + search_criteria_include_user_image_url: None, + search_criteria_include_work_items: None, + search_criteria_item_path: None, + search_criteria_item_version_version: None, + search_criteria_item_version_version_options: None, + search_criteria_item_version_version_type: None, + search_criteria_show_oldest_commits_first: None, + search_criteria_to_commit_id: None, + search_criteria_to_date: None, + search_criteria_user: None, + } + } + #[doc = "Retrieve a list of commits associated with a particular push."] + #[doc = ""] + #[doc = "See [`get_push_commits`](super::super::commits::Client::get_push_commits) for details of the arguments."] + pub fn get_push_commits( + &self, + organization: impl Into, + repository_id: impl Into, + push_id: i32, + project: impl Into, + ) -> get_push_commits::RequestBuilder { + get_push_commits::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + push_id, + project: project.into(), + top: None, + skip: None, + include_links: None, + } + } + #[doc = "Retrieve a particular commit."] + #[doc = ""] + #[doc = "See [`get`](super::super::commits::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + commit_id: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + commit_id: commit_id.into(), + repository_id: repository_id.into(), + project: project.into(), + change_count: None, + } + } + #[doc = "Retrieve changes for a particular commit."] + #[doc = ""] + #[doc = "See [`get_changes`](super::super::commits::Client::get_changes) for details of the arguments."] + pub fn get_changes( + &self, + organization: impl Into, + commit_id: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> get_changes::RequestBuilder { + get_changes::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + commit_id: commit_id.into(), + repository_id: repository_id.into(), + project: project.into(), + top: None, + skip: None, + } + } + #[doc = "Retrieve git commits for a project matching the search criteria"] + #[doc = ""] + #[doc = "See [`get_commits_batch`](super::super::commits::Client::get_commits_batch) for details of the arguments."] + pub fn get_commits_batch( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> get_commits_batch::RequestBuilder { + get_commits_batch::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + project: project.into(), + skip: None, + top: None, + include_statuses: None, + } + } + } + } + pub mod items { + use super::super::items::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download."] + #[doc = ""] + #[doc = "See [`get`](super::super::items::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + repository_id: impl Into, + path: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + path: path.into(), + project: project.into(), + scope_path: None, + recursion_level: None, + include_content_metadata: None, + latest_processed_change: None, + download: None, + format: None, + version_descriptor_version: None, + version_descriptor_version_options: None, + version_descriptor_version_type: None, + include_content: None, + resolve_lfs: None, + sanitize: None, + } + } + #[doc = "Get Item Metadata and/or Content for a collection of items. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download."] + #[doc = ""] + #[doc = "See [`list`](super::super::items::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + scope_path: None, + recursion_level: None, + include_content_metadata: None, + latest_processed_change: None, + download: None, + include_links: None, + format: None, + version_descriptor_version: None, + version_descriptor_version_options: None, + version_descriptor_version_type: None, + zip_for_unix: None, + } + } + #[doc = "Post for retrieving a creating a batch out of a set of items in a repo / project given a list of paths or a long path"] + #[doc = ""] + #[doc = "See [`get_items_batch`](super::super::items::Client::get_items_batch) for details of the arguments."] + pub fn get_items_batch( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> get_items_batch::RequestBuilder { + get_items_batch::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + project: project.into(), + } + } + } + } + pub mod stats { + use super::super::models; + use super::super::stats::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve statistics about a single branch."] + #[doc = ""] + #[doc = "See [`get`](super::super::stats::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + repository_id: impl Into, + name: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + name: name.into(), + project: project.into(), + base_version_descriptor_version: None, + base_version_descriptor_version_options: None, + base_version_descriptor_version_type: None, + } + } + #[doc = "Retrieve statistics about all branches within a repository."] + #[doc = ""] + #[doc = "See [`list`](super::super::stats::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + base_version_descriptor_version: None, + base_version_descriptor_version_options: None, + base_version_descriptor_version_type: None, + } + } + } + } + pub mod refs_favorites { + use super::super::models; + use super::super::refs_favorites::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the refs favorites for a repo and an identity."] + #[doc = ""] + #[doc = "See [`list`](super::super::refs_favorites::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + repository_id: None, + identity_id: None, + } + } + #[doc = "Creates a ref favorite"] + #[doc = ""] + #[doc = "See [`create`](super::super::refs_favorites::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Gets the refs favorite for a favorite Id."] + #[doc = ""] + #[doc = "See [`get`](super::super::refs_favorites::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + favorite_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + favorite_id, + } + } + #[doc = "Deletes the refs favorite specified"] + #[doc = ""] + #[doc = "See [`delete`](super::super::refs_favorites::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + favorite_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + favorite_id, + } + } + } + } + pub mod policy_configurations { + use super::super::models; + use super::super::policy_configurations::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve a list of policy configurations by a given set of scope/filtering criteria.\n\nBelow is a short description of how all of the query parameters interact with each other:\n- repositoryId set, refName set: returns all policy configurations that *apply* to a particular branch in a repository\n- repositoryId set, refName unset: returns all policy configurations that *apply* to a particular repository\n- repositoryId unset, refName unset: returns all policy configurations that are *defined* at the project level\n- repositoryId unset, refName set: returns all project-level branch policies, plus the project level configurations\nFor all of the examples above, when policyType is set, it'll restrict results to the given policy type"] + #[doc = ""] + #[doc = "See [`get`](super::super::policy_configurations::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + repository_id: None, + ref_name: None, + policy_type: None, + top: None, + continuation_token: None, + } + } + } + } + pub mod pull_requests { + use super::super::models; + use super::super::pull_requests::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve all pull requests matching a specified criteria.\n\nPlease note that description field will be truncated up to 400 symbols in the result."] + #[doc = ""] + #[doc = "See [`get_pull_requests_by_project`](super::super::pull_requests::Client::get_pull_requests_by_project) for details of the arguments."] + pub fn get_pull_requests_by_project( + &self, + organization: impl Into, + project: impl Into, + ) -> get_pull_requests_by_project::RequestBuilder { + get_pull_requests_by_project::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + search_criteria_creator_id: None, + search_criteria_include_links: None, + search_criteria_max_time: None, + search_criteria_min_time: None, + search_criteria_query_time_range_type: None, + search_criteria_repository_id: None, + search_criteria_reviewer_id: None, + search_criteria_source_ref_name: None, + search_criteria_source_repository_id: None, + search_criteria_status: None, + search_criteria_target_ref_name: None, + max_comment_length: None, + skip: None, + top: None, + } + } + #[doc = "Retrieve a pull request."] + #[doc = ""] + #[doc = "See [`get_pull_request_by_id`](super::super::pull_requests::Client::get_pull_request_by_id) for details of the arguments."] + pub fn get_pull_request_by_id( + &self, + organization: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> get_pull_request_by_id::RequestBuilder { + get_pull_request_by_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + pull_request_id, + project: project.into(), + } + } + #[doc = "Retrieve all pull requests matching a specified criteria.\n\nPlease note that description field will be truncated up to 400 symbols in the result."] + #[doc = ""] + #[doc = "See [`get_pull_requests`](super::super::pull_requests::Client::get_pull_requests) for details of the arguments."] + pub fn get_pull_requests( + &self, + organization: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> get_pull_requests::RequestBuilder { + get_pull_requests::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + search_criteria_creator_id: None, + search_criteria_include_links: None, + search_criteria_max_time: None, + search_criteria_min_time: None, + search_criteria_query_time_range_type: None, + search_criteria_repository_id: None, + search_criteria_reviewer_id: None, + search_criteria_source_ref_name: None, + search_criteria_source_repository_id: None, + search_criteria_status: None, + search_criteria_target_ref_name: None, + max_comment_length: None, + skip: None, + top: None, + } + } + #[doc = "Create a pull request."] + #[doc = ""] + #[doc = "See [`create`](super::super::pull_requests::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + repository_id: impl Into, + project: impl Into, + create_options: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + create_options: create_options.into(), + supports_iterations: None, + } + } + #[doc = "Retrieve a pull request."] + #[doc = ""] + #[doc = "See [`get_pull_request`](super::super::pull_requests::Client::get_pull_request) for details of the arguments."] + pub fn get_pull_request( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> get_pull_request::RequestBuilder { + get_pull_request::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + max_comment_length: None, + skip: None, + top: None, + include_commits: None, + include_work_item_refs: None, + } + } + #[doc = "Update a pull request\n\nThese are the properties that can be updated with the API:\n - Status\n - Title\n - Description (up to 4000 characters)\n - CompletionOptions\n - MergeOptions\n - AutoCompleteSetBy.Id\n - TargetRefName (when the PR retargeting feature is enabled)\n Attempting to update other properties outside of this list will either cause the server to throw an `InvalidArgumentValueException`,\n or to silently ignore the update."] + #[doc = ""] + #[doc = "See [`update`](super::super::pull_requests::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + repository_id: impl Into, + project: impl Into, + pull_request_id: i32, + update_options: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + pull_request_id, + update_options: update_options.into(), + include_commits: None, + include_work_item_refs: None, + } + } + } + } + pub mod annotated_tags { + use super::super::annotated_tags::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Create an annotated tag.\n\nRepositories have both a name and an identifier. Identifiers are globally unique, but several projects\nmay contain a repository of the same name. You don't need to include the project if you specify a\nrepository by ID. However, if you specify a repository by name, you must also specify the project (by name or ID)."] + #[doc = ""] + #[doc = "See [`create`](super::super::annotated_tags::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + repository_id: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + repository_id: repository_id.into(), + } + } + #[doc = "Get an annotated tag.\n\nRepositories have both a name and an identifier. Identifiers are globally unique, but several projects\nmay contain a repository of the same name. You don't need to include the project if you specify a\nrepository by ID. However, if you specify a repository by name, you must also specify the project (by name or ID)."] + #[doc = ""] + #[doc = "See [`get`](super::super::annotated_tags::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + repository_id: impl Into, + object_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + repository_id: repository_id.into(), + object_id: object_id.into(), + } + } + } + } + pub mod blobs { + use super::super::blobs::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets one or more blobs in a zip file download."] + #[doc = ""] + #[doc = "See [`get_blobs_zip`](super::super::blobs::Client::get_blobs_zip) for details of the arguments."] + pub fn get_blobs_zip( + &self, + organization: impl Into, + body: Vec, + repository_id: impl Into, + project: impl Into, + ) -> get_blobs_zip::RequestBuilder { + get_blobs_zip::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + repository_id: repository_id.into(), + project: project.into(), + filename: None, + } + } + #[doc = "Get a single blob.\n\nRepositories have both a name and an identifier. Identifiers are globally unique,\nbut several projects may contain a repository of the same name. You don't need to include\nthe project if you specify a repository by ID. However, if you specify a repository by name,\nyou must also specify the project (by name or ID)."] + #[doc = ""] + #[doc = "See [`get_blob`](super::super::blobs::Client::get_blob) for details of the arguments."] + pub fn get_blob( + &self, + organization: impl Into, + repository_id: impl Into, + sha1: impl Into, + project: impl Into, + ) -> get_blob::RequestBuilder { + get_blob::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + sha1: sha1.into(), + project: project.into(), + download: None, + file_name: None, + format: None, + resolve_lfs: None, + } + } + } + } + pub mod cherry_picks { + use super::super::cherry_picks::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve information about a cherry pick operation for a specific branch. This operation is expensive due to the underlying object structure, so this API only looks at the 1000 most recent cherry pick operations."] + #[doc = ""] + #[doc = "See [`get_cherry_pick_for_ref_name`](super::super::cherry_picks::Client::get_cherry_pick_for_ref_name) for details of the arguments."] + pub fn get_cherry_pick_for_ref_name( + &self, + organization: impl Into, + project: impl Into, + repository_id: impl Into, + ref_name: impl Into, + ) -> get_cherry_pick_for_ref_name::RequestBuilder { + get_cherry_pick_for_ref_name::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + repository_id: repository_id.into(), + ref_name: ref_name.into(), + } + } + #[doc = "Cherry pick a specific commit or commits that are associated to a pull request into a new branch."] + #[doc = ""] + #[doc = "See [`create`](super::super::cherry_picks::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + repository_id: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + repository_id: repository_id.into(), + } + } + #[doc = "Retrieve information about a cherry pick operation by cherry pick Id."] + #[doc = ""] + #[doc = "See [`get_cherry_pick`](super::super::cherry_picks::Client::get_cherry_pick) for details of the arguments."] + pub fn get_cherry_pick( + &self, + organization: impl Into, + project: impl Into, + cherry_pick_id: i32, + repository_id: impl Into, + ) -> get_cherry_pick::RequestBuilder { + get_cherry_pick::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + cherry_pick_id, + repository_id: repository_id.into(), + } + } + } + } + pub mod statuses { + use super::super::models; + use super::super::statuses::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get statuses associated with the Git commit."] + #[doc = ""] + #[doc = "See [`list`](super::super::statuses::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + commit_id: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + commit_id: commit_id.into(), + repository_id: repository_id.into(), + project: project.into(), + top: None, + skip: None, + latest_only: None, + } + } + #[doc = "Create Git commit status."] + #[doc = ""] + #[doc = "See [`create`](super::super::statuses::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + commit_id: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + commit_id: commit_id.into(), + repository_id: repository_id.into(), + project: project.into(), + } + } + } + } + pub mod diffs { + use super::super::diffs::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Find the closest common commit (the merge base) between base and target commits, and get the diff between either the base and target commits or common and target commits."] + #[doc = ""] + #[doc = "See [`get`](super::super::diffs::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + diff_common_commit: None, + top: None, + skip: None, + base_version: None, + base_version_options: None, + base_version_type: None, + target_version: None, + target_version_options: None, + target_version_type: None, + } + } + } + } + pub mod import_requests { + use super::super::import_requests::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve import requests for a repository."] + #[doc = ""] + #[doc = "See [`query`](super::super::import_requests::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + project: impl Into, + repository_id: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + repository_id: repository_id.into(), + include_abandoned: None, + } + } + #[doc = "Create an import request."] + #[doc = ""] + #[doc = "See [`create`](super::super::import_requests::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + repository_id: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + repository_id: repository_id.into(), + } + } + #[doc = "Retrieve a particular import request."] + #[doc = ""] + #[doc = "See [`get`](super::super::import_requests::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + repository_id: impl Into, + import_request_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + repository_id: repository_id.into(), + import_request_id, + } + } + #[doc = "Retry or abandon a failed import request.\n\nThere can only be one active import request associated with a repository. Marking a failed import request abandoned makes it inactive."] + #[doc = ""] + #[doc = "See [`update`](super::super::import_requests::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + repository_id: impl Into, + import_request_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + repository_id: repository_id.into(), + import_request_id, + } + } + } + } + pub mod pull_request_query { + use super::super::models; + use super::super::pull_request_query::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "This API is used to find what pull requests are related to a given commit. It can be used to either find the pull request that created a particular merge commit or it can be used to find all pull requests that have ever merged a particular commit. The input is a list of queries which each contain a list of commits. For each commit that you search against, you will get back a dictionary of commit -> pull requests."] + #[doc = ""] + #[doc = "See [`get`](super::super::pull_request_query::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + project: project.into(), + } + } + } + } + pub mod pull_request_attachments { + use super::super::models; + use super::super::pull_request_attachments::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of files attached to a given pull request."] + #[doc = ""] + #[doc = "See [`list`](super::super::pull_request_attachments::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + #[doc = "Get the file content of a pull request attachment."] + #[doc = ""] + #[doc = "See [`get`](super::super::pull_request_attachments::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + file_name: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + file_name: file_name.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + #[doc = "Attach a new file to a pull request."] + #[doc = ""] + #[doc = "See [`create`](super::super::pull_request_attachments::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + file_name: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + file_name: file_name.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + #[doc = "Delete a pull request attachment."] + #[doc = ""] + #[doc = "See [`delete`](super::super::pull_request_attachments::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + file_name: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + file_name: file_name.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + } + } + pub mod pull_request_commits { + use super::super::models; + use super::super::pull_request_commits::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the commits for the specified pull request."] + #[doc = ""] + #[doc = "See [`get_pull_request_commits`](super::super::pull_request_commits::Client::get_pull_request_commits) for details of the arguments."] + pub fn get_pull_request_commits( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> get_pull_request_commits::RequestBuilder { + get_pull_request_commits::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + top: None, + continuation_token: None, + } + } + #[doc = "Get the commits for the specified iteration of a pull request."] + #[doc = ""] + #[doc = "See [`get_pull_request_iteration_commits`](super::super::pull_request_commits::Client::get_pull_request_iteration_commits) for details of the arguments."] + pub fn get_pull_request_iteration_commits( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + iteration_id: i32, + project: impl Into, + ) -> get_pull_request_iteration_commits::RequestBuilder { + get_pull_request_iteration_commits::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + iteration_id, + project: project.into(), + top: None, + skip: None, + } + } + } + } + pub mod pull_request_iterations { + use super::super::models; + use super::super::pull_request_iterations::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the list of iterations for the specified pull request."] + #[doc = ""] + #[doc = "See [`list`](super::super::pull_request_iterations::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + include_commits: None, + } + } + #[doc = "Get the specified iteration for a pull request."] + #[doc = ""] + #[doc = "See [`get`](super::super::pull_request_iterations::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + iteration_id: i32, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + iteration_id, + project: project.into(), + } + } + } + } + pub mod pull_request_iteration_changes { + use super::super::models; + use super::super::pull_request_iteration_changes::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve the changes made in a pull request between two iterations."] + #[doc = ""] + #[doc = "See [`get`](super::super::pull_request_iteration_changes::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + iteration_id: i32, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + iteration_id, + project: project.into(), + top: None, + skip: None, + compare_to: None, + } + } + } + } + pub mod pull_request_iteration_statuses { + use super::super::models; + use super::super::pull_request_iteration_statuses::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all the statuses associated with a pull request iteration."] + #[doc = ""] + #[doc = "See [`list`](super::super::pull_request_iteration_statuses::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + iteration_id: i32, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + iteration_id, + project: project.into(), + } + } + #[doc = "Create a pull request status on the iteration. This operation will have the same result as Create status on pull request with specified iteration ID in the request body.\n\nThe only required field for the status is `Context.Name` that uniquely identifies the status.\nNote that `iterationId` in the request body is optional since `iterationId` can be specified in the URL.\nA conflict between `iterationId` in the URL and `iterationId` in the request body will result in status code 400."] + #[doc = ""] + #[doc = "See [`create`](super::super::pull_request_iteration_statuses::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + iteration_id: i32, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + iteration_id, + project: project.into(), + } + } + #[doc = "Update pull request iteration statuses collection. The only supported operation type is `remove`.\n\nThis operation allows to delete multiple statuses in one call.\nThe path of the `remove` operation should refer to the ID of the pull request status.\nFor example `path=\"/1\"` refers to the pull request status with ID 1."] + #[doc = ""] + #[doc = "See [`update`](super::super::pull_request_iteration_statuses::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + iteration_id: i32, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + iteration_id, + project: project.into(), + } + } + #[doc = "Get the specific pull request iteration status by ID. The status ID is unique within the pull request across all iterations."] + #[doc = ""] + #[doc = "See [`get`](super::super::pull_request_iteration_statuses::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + iteration_id: i32, + status_id: i32, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + iteration_id, + status_id, + project: project.into(), + } + } + #[doc = "Delete pull request iteration status.\n\nYou can remove multiple statuses in one call by using Update operation."] + #[doc = ""] + #[doc = "See [`delete`](super::super::pull_request_iteration_statuses::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + iteration_id: i32, + status_id: i32, + project: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + iteration_id, + status_id, + project: project.into(), + } + } + } + } + pub mod pull_request_labels { + use super::super::models; + use super::super::pull_request_labels::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all the labels (tags) assigned to a pull request."] + #[doc = ""] + #[doc = "See [`list`](super::super::pull_request_labels::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + project_id: None, + } + } + #[doc = "Create a tag (if that does not exists yet) and add that as a label (tag) for a specified pull request. The only required field is the name of the new label (tag)."] + #[doc = ""] + #[doc = "See [`create`](super::super::pull_request_labels::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + project_id: None, + } + } + #[doc = "Retrieves a single label (tag) that has been assigned to a pull request."] + #[doc = ""] + #[doc = "See [`get`](super::super::pull_request_labels::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + label_id_or_name: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + label_id_or_name: label_id_or_name.into(), + project: project.into(), + project_id: None, + } + } + #[doc = "Removes a label (tag) from the set of those assigned to the pull request. The tag itself will not be deleted."] + #[doc = ""] + #[doc = "See [`delete`](super::super::pull_request_labels::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + label_id_or_name: impl Into, + project: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + label_id_or_name: label_id_or_name.into(), + project: project.into(), + project_id: None, + } + } + } + } + pub mod pull_request_properties { + use super::super::models; + use super::super::pull_request_properties::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get external properties of the pull request."] + #[doc = ""] + #[doc = "See [`list`](super::super::pull_request_properties::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + #[doc = "Create or update pull request external properties. The patch operation can be `add`, `replace` or `remove`. For `add` operation, the path can be empty. If the path is empty, the value must be a list of key value pairs. For `replace` operation, the path cannot be empty. If the path does not exist, the property will be added to the collection. For `remove` operation, the path cannot be empty. If the path does not exist, no action will be performed."] + #[doc = ""] + #[doc = "See [`update`](super::super::pull_request_properties::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + } + } + pub mod pull_request_reviewers { + use super::super::models; + use super::super::pull_request_reviewers::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve the reviewers for a pull request"] + #[doc = ""] + #[doc = "See [`list`](super::super::pull_request_reviewers::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + #[doc = "Add reviewers to a pull request."] + #[doc = ""] + #[doc = "See [`create_pull_request_reviewers`](super::super::pull_request_reviewers::Client::create_pull_request_reviewers) for details of the arguments."] + pub fn create_pull_request_reviewers( + &self, + organization: impl Into, + body: Vec, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> create_pull_request_reviewers::RequestBuilder { + create_pull_request_reviewers::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + #[doc = "Add an unmaterialized identity to the reviewers of a pull request."] + #[doc = ""] + #[doc = "See [`create_unmaterialized_pull_request_reviewer`](super::super::pull_request_reviewers::Client::create_unmaterialized_pull_request_reviewer) for details of the arguments."] + pub fn create_unmaterialized_pull_request_reviewer( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> create_unmaterialized_pull_request_reviewer::RequestBuilder + { + create_unmaterialized_pull_request_reviewer::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + #[doc = "Reset the votes of multiple reviewers on a pull request. NOTE: This endpoint only supports updating votes, but does not support updating required reviewers (use policy) or display names."] + #[doc = ""] + #[doc = "See [`update_pull_request_reviewers`](super::super::pull_request_reviewers::Client::update_pull_request_reviewers) for details of the arguments."] + pub fn update_pull_request_reviewers( + &self, + organization: impl Into, + body: Vec, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> update_pull_request_reviewers::RequestBuilder { + update_pull_request_reviewers::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + #[doc = "Retrieve information about a particular reviewer on a pull request"] + #[doc = ""] + #[doc = "See [`get`](super::super::pull_request_reviewers::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + reviewer_id: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + reviewer_id: reviewer_id.into(), + project: project.into(), + } + } + #[doc = "Add a reviewer to a pull request or cast a vote."] + #[doc = ""] + #[doc = "See [`create_pull_request_reviewer`](super::super::pull_request_reviewers::Client::create_pull_request_reviewer) for details of the arguments."] + pub fn create_pull_request_reviewer( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + reviewer_id: impl Into, + project: impl Into, + ) -> create_pull_request_reviewer::RequestBuilder { + create_pull_request_reviewer::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + reviewer_id: reviewer_id.into(), + project: project.into(), + } + } + #[doc = "Edit a reviewer entry. These fields are patchable: isFlagged, hasDeclined"] + #[doc = ""] + #[doc = "See [`update_pull_request_reviewer`](super::super::pull_request_reviewers::Client::update_pull_request_reviewer) for details of the arguments."] + pub fn update_pull_request_reviewer( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + reviewer_id: impl Into, + project: impl Into, + ) -> update_pull_request_reviewer::RequestBuilder { + update_pull_request_reviewer::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + reviewer_id: reviewer_id.into(), + project: project.into(), + } + } + #[doc = "Remove a reviewer from a pull request."] + #[doc = ""] + #[doc = "See [`delete`](super::super::pull_request_reviewers::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + reviewer_id: impl Into, + project: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + reviewer_id: reviewer_id.into(), + project: project.into(), + } + } + } + } + pub mod pull_request_share { + use super::super::models; + use super::super::pull_request_share::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Sends an e-mail notification about a specific pull request to a set of recipients"] + #[doc = ""] + #[doc = "See [`share_pull_request`](super::super::pull_request_share::Client::share_pull_request) for details of the arguments."] + pub fn share_pull_request( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> share_pull_request::RequestBuilder { + share_pull_request::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + } + } + pub mod pull_request_statuses { + use super::super::models; + use super::super::pull_request_statuses::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all the statuses associated with a pull request."] + #[doc = ""] + #[doc = "See [`list`](super::super::pull_request_statuses::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + #[doc = "Create a pull request status.\n\nThe only required field for the status is `Context.Name` that uniquely identifies the status.\nNote that you can specify iterationId in the request body to post the status on the iteration."] + #[doc = ""] + #[doc = "See [`create`](super::super::pull_request_statuses::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + #[doc = "Update pull request statuses collection. The only supported operation type is `remove`.\n\nThis operation allows to delete multiple statuses in one call.\nThe path of the `remove` operation should refer to the ID of the pull request status.\nFor example `path=\"/1\"` refers to the pull request status with ID 1."] + #[doc = ""] + #[doc = "See [`update`](super::super::pull_request_statuses::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + #[doc = "Get the specific pull request status by ID. The status ID is unique within the pull request across all iterations."] + #[doc = ""] + #[doc = "See [`get`](super::super::pull_request_statuses::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + status_id: i32, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + status_id, + project: project.into(), + } + } + #[doc = "Delete pull request status.\n\nYou can remove multiple statuses in one call by using Update operation."] + #[doc = ""] + #[doc = "See [`delete`](super::super::pull_request_statuses::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + status_id: i32, + project: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + status_id, + project: project.into(), + } + } + } + } + pub mod pull_request_threads { + use super::super::models; + use super::super::pull_request_threads::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve all threads in a pull request."] + #[doc = ""] + #[doc = "See [`list`](super::super::pull_request_threads::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + iteration: None, + base_iteration: None, + } + } + #[doc = "Create a thread in a pull request."] + #[doc = ""] + #[doc = "See [`create`](super::super::pull_request_threads::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + #[doc = "Retrieve a thread in a pull request."] + #[doc = ""] + #[doc = "See [`get`](super::super::pull_request_threads::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + thread_id: i32, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + thread_id, + project: project.into(), + iteration: None, + base_iteration: None, + } + } + #[doc = "Update a thread in a pull request."] + #[doc = ""] + #[doc = "See [`update`](super::super::pull_request_threads::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + thread_id: i32, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + thread_id, + project: project.into(), + } + } + } + } + pub mod pull_request_thread_comments { + use super::super::models; + use super::super::pull_request_thread_comments::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve all comments associated with a specific thread in a pull request."] + #[doc = ""] + #[doc = "See [`list`](super::super::pull_request_thread_comments::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + thread_id: i32, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + thread_id, + project: project.into(), + } + } + #[doc = "Create a comment on a specific thread in a pull request (up to 500 comments can be created per thread)."] + #[doc = ""] + #[doc = "See [`create`](super::super::pull_request_thread_comments::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + thread_id: i32, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + thread_id, + project: project.into(), + } + } + #[doc = "Retrieve a comment associated with a specific thread in a pull request."] + #[doc = ""] + #[doc = "See [`get`](super::super::pull_request_thread_comments::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + thread_id: i32, + comment_id: i32, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + thread_id, + comment_id, + project: project.into(), + } + } + #[doc = "Update a comment associated with a specific thread in a pull request."] + #[doc = ""] + #[doc = "See [`update`](super::super::pull_request_thread_comments::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + pull_request_id: i32, + thread_id: i32, + comment_id: i32, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + pull_request_id, + thread_id, + comment_id, + project: project.into(), + } + } + #[doc = "Delete a comment associated with a specific thread in a pull request."] + #[doc = ""] + #[doc = "See [`delete`](super::super::pull_request_thread_comments::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + thread_id: i32, + comment_id: i32, + project: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + thread_id, + comment_id, + project: project.into(), + } + } + } + } + pub mod pull_request_comment_likes { + use super::super::models; + use super::super::pull_request_comment_likes::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get likes for a comment."] + #[doc = ""] + #[doc = "See [`list`](super::super::pull_request_comment_likes::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + thread_id: i32, + comment_id: i32, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + thread_id, + comment_id, + project: project.into(), + } + } + #[doc = "Add a like on a comment."] + #[doc = ""] + #[doc = "See [`create`](super::super::pull_request_comment_likes::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + thread_id: i32, + comment_id: i32, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + thread_id, + comment_id, + project: project.into(), + } + } + #[doc = "Delete a like on a comment."] + #[doc = ""] + #[doc = "See [`delete`](super::super::pull_request_comment_likes::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + thread_id: i32, + comment_id: i32, + project: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + thread_id, + comment_id, + project: project.into(), + } + } + } + } + pub mod pull_request_work_items { + use super::super::models; + use super::super::pull_request_work_items::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve a list of work items associated with a pull request."] + #[doc = ""] + #[doc = "See [`list`](super::super::pull_request_work_items::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + pull_request_id: i32, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + pull_request_id, + project: project.into(), + } + } + } + } + pub mod pushes { + use super::super::models; + use super::super::pushes::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieves pushes associated with the specified repository."] + #[doc = ""] + #[doc = "See [`list`](super::super::pushes::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + skip: None, + top: None, + search_criteria_from_date: None, + search_criteria_include_links: None, + search_criteria_include_ref_updates: None, + search_criteria_pusher_id: None, + search_criteria_ref_name: None, + search_criteria_to_date: None, + } + } + #[doc = "Push changes to the repository."] + #[doc = ""] + #[doc = "See [`create`](super::super::pushes::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + project: project.into(), + } + } + #[doc = "Retrieves a particular push."] + #[doc = ""] + #[doc = "See [`get`](super::super::pushes::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + repository_id: impl Into, + push_id: i32, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + push_id, + project: project.into(), + include_commits: None, + include_ref_updates: None, + } + } + } + } + pub mod refs { + use super::super::models; + use super::super::refs::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Queries the provided repository for its refs and returns them."] + #[doc = ""] + #[doc = "See [`list`](super::super::refs::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + filter: None, + include_links: None, + include_statuses: None, + include_my_branches: None, + latest_statuses_only: None, + peel_tags: None, + filter_contains: None, + top: None, + continuation_token: None, + } + } + #[doc = "Creating, updating, or deleting refs(branches).\n\nUpdating a ref means making it point at a different commit than it used to. You must specify both the old and new commit to avoid race conditions."] + #[doc = ""] + #[doc = "See [`update_refs`](super::super::refs::Client::update_refs) for details of the arguments."] + pub fn update_refs( + &self, + organization: impl Into, + body: Vec, + repository_id: impl Into, + project: impl Into, + ) -> update_refs::RequestBuilder { + update_refs::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + repository_id: repository_id.into(), + project: project.into(), + project_id: None, + } + } + #[doc = "Lock or Unlock a branch."] + #[doc = ""] + #[doc = "See [`update_ref`](super::super::refs::Client::update_ref) for details of the arguments."] + pub fn update_ref( + &self, + organization: impl Into, + body: impl Into, + repository_id: impl Into, + filter: impl Into, + project: impl Into, + ) -> update_ref::RequestBuilder { + update_ref::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_id: repository_id.into(), + filter: filter.into(), + project: project.into(), + project_id: None, + } + } + } + } + pub mod reverts { + use super::super::models; + use super::super::reverts::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve information about a revert operation for a specific branch."] + #[doc = ""] + #[doc = "See [`get_revert_for_ref_name`](super::super::reverts::Client::get_revert_for_ref_name) for details of the arguments."] + pub fn get_revert_for_ref_name( + &self, + organization: impl Into, + project: impl Into, + repository_id: impl Into, + ref_name: impl Into, + ) -> get_revert_for_ref_name::RequestBuilder { + get_revert_for_ref_name::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + repository_id: repository_id.into(), + ref_name: ref_name.into(), + } + } + #[doc = "Starts the operation to create a new branch which reverts changes introduced by either a specific commit or commits that are associated to a pull request."] + #[doc = ""] + #[doc = "See [`create`](super::super::reverts::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + repository_id: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + repository_id: repository_id.into(), + } + } + #[doc = "Retrieve information about a revert operation by revert Id."] + #[doc = ""] + #[doc = "See [`get_revert`](super::super::reverts::Client::get_revert) for details of the arguments."] + pub fn get_revert( + &self, + organization: impl Into, + project: impl Into, + revert_id: i32, + repository_id: impl Into, + ) -> get_revert::RequestBuilder { + get_revert::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + revert_id, + repository_id: repository_id.into(), + } + } + } + } + pub mod suggestions { + use super::super::models; + use super::super::suggestions::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve a pull request suggestion for a particular repository or team project."] + #[doc = ""] + #[doc = "See [`list`](super::super::suggestions::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_id: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + project: project.into(), + } + } + } + } + pub mod trees { + use super::super::models; + use super::super::trees::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "The Tree endpoint returns the collection of objects underneath the specified tree. Trees are folders in a Git repository.\n\nRepositories have both a name and an identifier. Identifiers are globally unique, but several projects may contain a repository of the same name. You don't need to include the project if you specify a repository by ID. However, if you specify a repository by name, you must also specify the project (by name or ID."] + #[doc = ""] + #[doc = "See [`get`](super::super::trees::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + repository_id: impl Into, + sha1: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_id: repository_id.into(), + sha1: sha1.into(), + project: project.into(), + project_id: None, + recursive: None, + file_name: None, + format: None, + } + } + } + } + pub mod merge_bases { + use super::super::merge_bases::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Find the merge bases of two commits, optionally across forks. If otherRepositoryId is not specified, the merge bases will only be calculated within the context of the local repositoryNameOrId."] + #[doc = ""] + #[doc = "See [`list`](super::super::merge_bases::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_name_or_id: impl Into, + commit_id: impl Into, + other_commit_id: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_name_or_id: repository_name_or_id.into(), + commit_id: commit_id.into(), + other_commit_id: other_commit_id.into(), + project: project.into(), + other_collection_id: None, + other_repository_id: None, + } + } + } + } + pub mod forks { + use super::super::forks::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve all forks of a repository in the collection."] + #[doc = ""] + #[doc = "See [`list`](super::super::forks::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + repository_name_or_id: impl Into, + collection_id: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_name_or_id: repository_name_or_id.into(), + collection_id: collection_id.into(), + project: project.into(), + include_links: None, + } + } + #[doc = "Retrieve all requested fork sync operations on this repository."] + #[doc = ""] + #[doc = "See [`get_fork_sync_requests`](super::super::forks::Client::get_fork_sync_requests) for details of the arguments."] + pub fn get_fork_sync_requests( + &self, + organization: impl Into, + repository_name_or_id: impl Into, + project: impl Into, + ) -> get_fork_sync_requests::RequestBuilder { + get_fork_sync_requests::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_name_or_id: repository_name_or_id.into(), + project: project.into(), + include_abandoned: None, + include_links: None, + } + } + #[doc = "Request that another repository's refs be fetched into this one. It syncs two existing forks. To create a fork, please see the repositories endpoint"] + #[doc = ""] + #[doc = "See [`create_fork_sync_request`](super::super::forks::Client::create_fork_sync_request) for details of the arguments."] + pub fn create_fork_sync_request( + &self, + organization: impl Into, + body: impl Into, + repository_name_or_id: impl Into, + project: impl Into, + ) -> create_fork_sync_request::RequestBuilder { + create_fork_sync_request::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + repository_name_or_id: repository_name_or_id.into(), + project: project.into(), + include_links: None, + } + } + #[doc = "Get a specific fork sync operation's details."] + #[doc = ""] + #[doc = "See [`get_fork_sync_request`](super::super::forks::Client::get_fork_sync_request) for details of the arguments."] + pub fn get_fork_sync_request( + &self, + organization: impl Into, + repository_name_or_id: impl Into, + fork_sync_operation_id: i32, + project: impl Into, + ) -> get_fork_sync_request::RequestBuilder { + get_fork_sync_request::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + repository_name_or_id: repository_name_or_id.into(), + fork_sync_operation_id, + project: project.into(), + include_links: None, + } + } + } + } + pub mod merges { + use super::super::merges::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Request a git merge operation. Currently we support merging only 2 commits."] + #[doc = ""] + #[doc = "See [`create`](super::super::merges::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + repository_name_or_id: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + repository_name_or_id: repository_name_or_id.into(), + include_links: None, + } + } + #[doc = "Get a specific merge operation's details."] + #[doc = ""] + #[doc = "See [`get`](super::super::merges::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + repository_name_or_id: impl Into, + merge_operation_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + repository_name_or_id: repository_name_or_id.into(), + merge_operation_id, + include_links: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/graph/mod.rs b/azure_devops_rust_api/src/graph/mod.rs index 380f198f..49ecb148 100644 --- a/azure_devops_rust_api/src/graph/mod.rs +++ b/azure_devops_rust_api/src/graph/mod.rs @@ -226,11 +226,43 @@ pub mod descriptors { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) storage_key: String, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/descriptors/{}", + self.client.endpoint(), + self.organization, + self.storage_key + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -240,9 +272,7 @@ pub mod descriptors { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -254,25 +284,24 @@ pub mod descriptors { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/descriptors/{}", - self.client.endpoint(), - self.organization, - self.storage_key - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -426,14 +455,18 @@ pub mod groups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) scope_descriptor: Option, pub(crate) subject_types: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Specify a non-default scope (collection, project) to search for groups."] pub fn scope_descriptor(mut self, scope_descriptor: impl Into) -> Self { self.scope_descriptor = Some(scope_descriptor.into()); @@ -449,6 +482,49 @@ pub mod groups { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(scope_descriptor) = &this.scope_descriptor { + req.url_mut() + .query_pairs_mut() + .append_pair("scopeDescriptor", scope_descriptor); + } + if let Some(subject_types) = &this.subject_types { + req.url_mut() + .query_pairs_mut() + .append_pair("subjectTypes", subject_types); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -457,9 +533,7 @@ pub mod groups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -471,39 +545,24 @@ pub mod groups { auth_header, ); } - if let Some(scope_descriptor) = &this.scope_descriptor { - req.url_mut() - .query_pairs_mut() - .append_pair("scopeDescriptor", scope_descriptor); - } - if let Some(subject_types) = &this.subject_types { - req.url_mut() - .query_pairs_mut() - .append_pair("subjectTypes", subject_types); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -553,14 +612,18 @@ pub mod groups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GraphGroupCreationContext, pub(crate) scope_descriptor: Option, pub(crate) group_descriptors: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A descriptor referencing the scope (collection, project) in which the group should be created. If omitted, will be created in the scope of the enclosing account or organization. Valid only for VSTS groups."] pub fn scope_descriptor(mut self, scope_descriptor: impl Into) -> Self { self.scope_descriptor = Some(scope_descriptor.into()); @@ -571,6 +634,45 @@ pub mod groups { self.group_descriptors = Some(group_descriptors.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + if let Some(scope_descriptor) = &this.scope_descriptor { + req.url_mut() + .query_pairs_mut() + .append_pair("scopeDescriptor", scope_descriptor); + } + 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(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -579,9 +681,7 @@ pub mod groups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -593,35 +693,24 @@ pub mod groups { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - if let Some(scope_descriptor) = &this.scope_descriptor { - req.url_mut() - .query_pairs_mut() - .append_pair("scopeDescriptor", scope_descriptor); - } - 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?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -671,11 +760,43 @@ pub mod groups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) group_descriptor: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/groups/{}", + self.client.endpoint(), + self.organization, + self.group_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -685,9 +806,7 @@ pub mod groups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -699,25 +818,24 @@ pub mod groups { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/groups/{}", - self.client.endpoint(), - self.organization, - self.group_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -767,12 +885,45 @@ pub mod groups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) group_descriptor: String, pub(crate) body: models::JsonPatchDocument, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/groups/{}", + self.client.endpoint(), + self.organization, + self.group_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -782,9 +933,7 @@ pub mod groups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -796,26 +945,24 @@ pub mod groups { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/groups/{}", - self.client.endpoint(), - self.organization, - self.group_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -860,11 +1007,43 @@ pub mod groups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) group_descriptor: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/groups/{}", + self.client.endpoint(), + self.organization, + self.group_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -874,9 +1053,7 @@ pub mod groups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -888,25 +1065,24 @@ pub mod groups { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/groups/{}", - self.client.endpoint(), - self.organization, - self.group_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1063,14 +1239,18 @@ pub mod memberships { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) subject_descriptor: String, pub(crate) direction: Option, pub(crate) depth: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Defaults to Up."] pub fn direction( mut self, @@ -1084,6 +1264,45 @@ pub mod memberships { self.depth = Some(depth); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(direction) = &this.direction { + req.url_mut() + .query_pairs_mut() + .append_pair("direction", &direction.to_string()); + } + if let Some(depth) = &this.depth { + req.url_mut() + .query_pairs_mut() + .append_pair("depth", &depth.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/Memberships/{}", + self.client.endpoint(), + self.organization, + self.subject_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1092,9 +1311,7 @@ pub mod memberships { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1106,35 +1323,24 @@ pub mod memberships { auth_header, ); } - if let Some(direction) = &this.direction { - req.url_mut() - .query_pairs_mut() - .append_pair("direction", &direction.to_string()); - } - if let Some(depth) = &this.depth { - req.url_mut() - .query_pairs_mut() - .append_pair("depth", &depth.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/Memberships/{}", - self.client.endpoint(), - self.organization, - self.subject_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1184,12 +1390,45 @@ pub mod memberships { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) subject_descriptor: String, pub(crate) container_descriptor: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/memberships/{}/{}", + self.client.endpoint(), + self.organization, + self.subject_descriptor, + self.container_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1199,9 +1438,7 @@ pub mod memberships { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1213,26 +1450,24 @@ pub mod memberships { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/memberships/{}/{}", - self.client.endpoint(), - self.organization, - self.subject_descriptor, - self.container_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1282,12 +1517,45 @@ pub mod memberships { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) subject_descriptor: String, pub(crate) container_descriptor: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/memberships/{}/{}", + self.client.endpoint(), + self.organization, + self.subject_descriptor, + self.container_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1297,9 +1565,7 @@ pub mod memberships { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1311,26 +1577,24 @@ pub mod memberships { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/memberships/{}/{}", - self.client.endpoint(), - self.organization, - self.subject_descriptor, - self.container_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1375,12 +1639,45 @@ pub mod memberships { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) subject_descriptor: String, pub(crate) container_descriptor: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/memberships/{}/{}", + self.client.endpoint(), + self.organization, + self.subject_descriptor, + self.container_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1390,9 +1687,7 @@ pub mod memberships { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1404,26 +1699,24 @@ pub mod memberships { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/memberships/{}/{}", - self.client.endpoint(), - self.organization, - self.subject_descriptor, - self.container_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1471,12 +1764,45 @@ pub mod memberships { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) subject_descriptor: String, pub(crate) container_descriptor: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Head); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/memberships/{}/{}", + self.client.endpoint(), + self.organization, + self.subject_descriptor, + self.container_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1486,9 +1812,7 @@ pub mod memberships { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Head); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1500,26 +1824,24 @@ pub mod memberships { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/memberships/{}/{}", - self.client.endpoint(), - self.organization, - self.subject_descriptor, - self.container_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1598,11 +1920,43 @@ pub mod membership_states { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) subject_descriptor: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/membershipstates/{}", + self.client.endpoint(), + self.organization, + self.subject_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1612,9 +1966,7 @@ pub mod membership_states { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1626,25 +1978,24 @@ pub mod membership_states { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/membershipstates/{}", - self.client.endpoint(), - self.organization, - self.subject_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1712,11 +2063,43 @@ pub mod request_access { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::JToken, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1726,9 +2109,7 @@ pub mod request_access { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1740,25 +2121,24 @@ pub mod request_access { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1897,13 +2277,17 @@ pub mod service_principals { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) continuation_token: Option, pub(crate) scope_descriptor: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "An opaque data blob that allows the next page of data to resume immediately after where the previous page ended. The only reliable way to know if there is more data left is the presence of a continuation token."] pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { self.continuation_token = Some(continuation_token.into()); @@ -1914,6 +2298,44 @@ pub mod service_principals { self.scope_descriptor = Some(scope_descriptor.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(scope_descriptor) = &this.scope_descriptor { + req.url_mut() + .query_pairs_mut() + .append_pair("scopeDescriptor", scope_descriptor); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1922,9 +2344,7 @@ pub mod service_principals { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1936,34 +2356,24 @@ pub mod service_principals { auth_header, ); } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(scope_descriptor) = &this.scope_descriptor { - req.url_mut() - .query_pairs_mut() - .append_pair("scopeDescriptor", scope_descriptor); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2014,18 +2424,56 @@ pub mod service_principals { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GraphServicePrincipalCreationContext, pub(crate) group_descriptors: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A comma separated list of descriptors of groups you want the graph service principal to join"] pub fn group_descriptors(mut self, group_descriptors: impl Into) -> Self { self.group_descriptors = Some(group_descriptors.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2034,9 +2482,7 @@ pub mod service_principals { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2048,30 +2494,24 @@ pub mod service_principals { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2121,39 +2561,27 @@ pub mod service_principals { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) service_principal_descriptor: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -2170,6 +2598,47 @@ pub mod service_principals { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -2212,11 +2681,43 @@ pub mod service_principals { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) service_principal_descriptor: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/serviceprincipals/{}", + self.client.endpoint(), + self.organization, + self.service_principal_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2226,9 +2727,7 @@ pub mod service_principals { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2240,25 +2739,24 @@ pub mod service_principals { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/serviceprincipals/{}", - self.client.endpoint(), - self.organization, - self.service_principal_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2336,11 +2834,43 @@ pub mod storage_keys { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) subject_descriptor: String, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/storagekeys/{}", + self.client.endpoint(), + self.organization, + self.subject_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2350,9 +2880,7 @@ pub mod storage_keys { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2364,25 +2892,24 @@ pub mod storage_keys { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/storagekeys/{}", - self.client.endpoint(), - self.organization, - self.subject_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2458,11 +2985,43 @@ pub mod subject_lookup { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GraphSubjectLookup, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2472,9 +3031,7 @@ pub mod subject_lookup { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2486,25 +3043,24 @@ pub mod subject_lookup { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2580,11 +3136,43 @@ pub mod subject_query { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GraphSubjectQuery, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2594,9 +3182,7 @@ pub mod subject_query { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2608,25 +3194,24 @@ pub mod subject_query { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2729,14 +3314,18 @@ pub mod avatars { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) subject_descriptor: String, pub(crate) organization: String, pub(crate) size: Option, pub(crate) format: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn size(mut self, size: impl Into) -> Self { self.size = Some(size.into()); self @@ -2745,6 +3334,45 @@ pub mod avatars { self.format = Some(format.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(size) = &this.size { + req.url_mut() + .query_pairs_mut() + .append_pair("size", &size.to_string()); + } + if let Some(format) = &this.format { + req.url_mut() + .query_pairs_mut() + .append_pair("format", format); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/Subjects/{}/avatars", + self.client.endpoint(), + self.organization, + self.subject_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2753,9 +3381,7 @@ pub mod avatars { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2767,35 +3393,24 @@ pub mod avatars { auth_header, ); } - if let Some(size) = &this.size { - req.url_mut() - .query_pairs_mut() - .append_pair("size", &size.to_string()); - } - if let Some(format) = &this.format { - req.url_mut() - .query_pairs_mut() - .append_pair("format", format); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/Subjects/{}/avatars", - self.client.endpoint(), - self.organization, - self.subject_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2840,12 +3455,45 @@ pub mod avatars { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) body: models::Avatar, pub(crate) subject_descriptor: String, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/Subjects/{}/avatars", + self.client.endpoint(), + self.organization, + self.subject_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2855,9 +3503,7 @@ pub mod avatars { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2869,26 +3515,24 @@ pub mod avatars { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/Subjects/{}/avatars", - self.client.endpoint(), - self.organization, - self.subject_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2936,11 +3580,43 @@ pub mod avatars { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) subject_descriptor: String, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/Subjects/{}/avatars", + self.client.endpoint(), + self.organization, + self.subject_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2950,9 +3626,7 @@ pub mod avatars { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2964,25 +3638,24 @@ pub mod avatars { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/Subjects/{}/avatars", - self.client.endpoint(), - self.organization, - self.subject_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3138,14 +3811,18 @@ pub mod users { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) subject_types: Option, pub(crate) continuation_token: Option, pub(crate) scope_descriptor: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A comma separated list of user subject subtypes to reduce the retrieved results, e.g. msa’, ‘aad’, ‘svc’ (service identity), ‘imp’ (imported identity), etc."] pub fn subject_types(mut self, subject_types: impl Into) -> Self { self.subject_types = Some(subject_types.into()); @@ -3161,6 +3838,49 @@ pub mod users { self.scope_descriptor = Some(scope_descriptor.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(subject_types) = &this.subject_types { + req.url_mut() + .query_pairs_mut() + .append_pair("subjectTypes", subject_types); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(scope_descriptor) = &this.scope_descriptor { + req.url_mut() + .query_pairs_mut() + .append_pair("scopeDescriptor", scope_descriptor); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3169,9 +3889,7 @@ pub mod users { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3183,39 +3901,24 @@ pub mod users { auth_header, ); } - if let Some(subject_types) = &this.subject_types { - req.url_mut() - .query_pairs_mut() - .append_pair("subjectTypes", subject_types); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(scope_descriptor) = &this.scope_descriptor { - req.url_mut() - .query_pairs_mut() - .append_pair("scopeDescriptor", scope_descriptor); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3265,18 +3968,56 @@ pub mod users { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GraphUserCreationContext, pub(crate) group_descriptors: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A comma separated list of descriptors of groups you want the graph user to join"] pub fn group_descriptors(mut self, group_descriptors: impl Into) -> Self { self.group_descriptors = Some(group_descriptors.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3285,9 +4026,7 @@ pub mod users { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3299,30 +4038,24 @@ pub mod users { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3372,11 +4105,43 @@ pub mod users { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) user_descriptor: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/users/{}", + self.client.endpoint(), + self.organization, + self.user_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3386,9 +4151,7 @@ pub mod users { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3400,25 +4163,24 @@ pub mod users { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/users/{}", - self.client.endpoint(), - self.organization, - self.user_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3468,12 +4230,45 @@ pub mod users { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GraphUserUpdateContext, pub(crate) user_descriptor: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/users/{}", + self.client.endpoint(), + self.organization, + self.user_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3483,9 +4278,7 @@ pub mod users { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3497,26 +4290,24 @@ pub mod users { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/users/{}", - self.client.endpoint(), - self.organization, - self.user_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3561,11 +4352,43 @@ pub mod users { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) user_descriptor: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/users/{}", + self.client.endpoint(), + self.organization, + self.user_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3575,9 +4398,7 @@ pub mod users { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3589,25 +4410,24 @@ pub mod users { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/users/{}", - self.client.endpoint(), - self.organization, - self.user_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3683,11 +4503,43 @@ pub mod provider_info { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) user_descriptor: String, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/graph/Users/{}/providerinfo", + self.client.endpoint(), + self.organization, + self.user_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3697,9 +4549,7 @@ pub mod provider_info { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3711,25 +4561,24 @@ pub mod provider_info { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/graph/Users/{}/providerinfo", - self.client.endpoint(), - self.organization, - self.user_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3746,3 +4595,622 @@ pub mod provider_info { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn avatars_client(&self) -> avatars::Client { + avatars::Client(self.clone()) + } + pub fn descriptors_client(&self) -> descriptors::Client { + descriptors::Client(self.clone()) + } + pub fn groups_client(&self) -> groups::Client { + groups::Client(self.clone()) + } + pub fn membership_states_client(&self) -> membership_states::Client { + membership_states::Client(self.clone()) + } + pub fn memberships_client(&self) -> memberships::Client { + memberships::Client(self.clone()) + } + pub fn provider_info_client(&self) -> provider_info::Client { + provider_info::Client(self.clone()) + } + pub fn request_access_client(&self) -> request_access::Client { + request_access::Client(self.clone()) + } + pub fn service_principals_client(&self) -> service_principals::Client { + service_principals::Client(self.clone()) + } + pub fn storage_keys_client(&self) -> storage_keys::Client { + storage_keys::Client(self.clone()) + } + pub fn subject_lookup_client(&self) -> subject_lookup::Client { + subject_lookup::Client(self.clone()) + } + pub fn subject_query_client(&self) -> subject_query::Client { + subject_query::Client(self.clone()) + } + pub fn users_client(&self) -> users::Client { + users::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod descriptors { + use super::super::descriptors::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Resolve a storage key to a descriptor"] + #[doc = ""] + #[doc = "See [`get`](super::super::descriptors::Client::get) for details of the arguments."] + pub fn get( + &self, + storage_key: impl Into, + organization: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + storage_key: storage_key.into(), + organization: organization.into(), + } + } + } + } + pub mod groups { + use super::super::groups::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a list of all groups in the current scope (usually organization or account).\n\nThe optional parameters are used to filter down the returned results. Returned results are in no guaranteed order.\n\n Since the list of groups may be large, results are returned in pages of groups. If there are more results\n than can be returned in a single page, the result set will contain a continuation token for retrieval of the\n next set of results."] + #[doc = ""] + #[doc = "See [`list`](super::super::groups::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + scope_descriptor: None, + subject_types: None, + continuation_token: None, + } + } + #[doc = "Create a new Azure DevOps group or materialize an existing AAD group.\n\nThe body of the request must be a derived type of GraphGroupCreationContext:\n * GraphGroupVstsCreationContext - Create a new Azure DevOps group that is not backed by an external provider.\n * GraphGroupMailAddressCreationContext - Create a new group using the mail address as a reference to an existing group from an external AD or AAD backed provider.\n * GraphGroupOriginIdCreationContext - Create a new group using the OriginID as a reference to a group from an external AD or AAD backed provider.\n\n Optionally, you can add the newly created group as a member of an existing Azure DevOps group and/or specify a custom storage key for the group."] + #[doc = ""] + #[doc = "See [`create`](super::super::groups::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + scope_descriptor: None, + group_descriptors: None, + } + } + #[doc = "Get a group by its descriptor.\n\nThe group will be returned even if it has been deleted from the account or has had all its memberships\ndeleted."] + #[doc = ""] + #[doc = "See [`get`](super::super::groups::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + group_descriptor: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + group_descriptor: group_descriptor.into(), + } + } + #[doc = "Update the properties of an Azure DevOps group.\n\nCurrently limited to only changing the description and account name."] + #[doc = ""] + #[doc = "See [`update`](super::super::groups::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + group_descriptor: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + group_descriptor: group_descriptor.into(), + body: body.into(), + } + } + #[doc = "Removes an Azure DevOps group from all of its parent groups.\n\nThe group will still be visible, but membership\n checks for the group, and all descendants which derive membership through it, will return false.”"] + #[doc = ""] + #[doc = "See [`delete`](super::super::groups::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + group_descriptor: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + group_descriptor: group_descriptor.into(), + } + } + } + } + pub mod memberships { + use super::super::memberships::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all the memberships where this descriptor is a member in the relationship.\n\nThe default value for direction is 'up' meaning return all memberships where the subject is a member (e.g. all groups the subject is a member of).\n Alternatively, passing the direction as 'down' will return all memberships where the subject is a container (e.g. all members of the subject group)."] + #[doc = ""] + #[doc = "See [`list`](super::super::memberships::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + subject_descriptor: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subject_descriptor: subject_descriptor.into(), + direction: None, + depth: None, + } + } + #[doc = "Get a membership relationship between a container and subject."] + #[doc = ""] + #[doc = "See [`get`](super::super::memberships::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + subject_descriptor: impl Into, + container_descriptor: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subject_descriptor: subject_descriptor.into(), + container_descriptor: container_descriptor.into(), + } + } + #[doc = "Create a new membership between a container and subject."] + #[doc = ""] + #[doc = "See [`add`](super::super::memberships::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + subject_descriptor: impl Into, + container_descriptor: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subject_descriptor: subject_descriptor.into(), + container_descriptor: container_descriptor.into(), + } + } + #[doc = "Deletes a membership between a container and subject."] + #[doc = ""] + #[doc = "See [`remove_membership`](super::super::memberships::Client::remove_membership) for details of the arguments."] + pub fn remove_membership( + &self, + organization: impl Into, + subject_descriptor: impl Into, + container_descriptor: impl Into, + ) -> remove_membership::RequestBuilder { + remove_membership::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subject_descriptor: subject_descriptor.into(), + container_descriptor: container_descriptor.into(), + } + } + #[doc = "Check to see if a membership relationship between a container and subject exists."] + #[doc = ""] + #[doc = "See [`check_membership_existence`](super::super::memberships::Client::check_membership_existence) for details of the arguments."] + pub fn check_membership_existence( + &self, + organization: impl Into, + subject_descriptor: impl Into, + container_descriptor: impl Into, + ) -> check_membership_existence::RequestBuilder { + check_membership_existence::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subject_descriptor: subject_descriptor.into(), + container_descriptor: container_descriptor.into(), + } + } + } + } + pub mod membership_states { + use super::super::membership_states::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Check whether a subject is active or inactive."] + #[doc = ""] + #[doc = "See [`get`](super::super::membership_states::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + subject_descriptor: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subject_descriptor: subject_descriptor.into(), + } + } + } + } + pub mod request_access { + use super::super::models; + use super::super::request_access::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`request_access`](super::super::request_access::Client::request_access) for details of the arguments."] + pub fn request_access( + &self, + organization: impl Into, + body: impl Into, + ) -> request_access::RequestBuilder { + request_access::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + } + } + pub mod service_principals { + use super::super::models; + use super::super::service_principals::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of all service principals in a given scope.\n\nSince the list of service principals may be large, results are returned in pages of service principals. If there are more results\n than can be returned in a single page, the result set will contain a continuation token for retrieval of the\n next set of results. The only reliable way to know if there is no more service principals left is the lack of a continuation token."] + #[doc = ""] + #[doc = "See [`list`](super::super::service_principals::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + continuation_token: None, + scope_descriptor: None, + } + } + #[doc = "Materialize an existing AAD service principal into the ADO account.\n\nNOTE: Created service principals are not active in an account.\n\n Adding a service principal to an account is required before the service principal can be added to ADO groups or assigned an asset.\n\n The body of the request must be a derived type of GraphServicePrincipalCreationContext:\n * GraphServicePrincipalOriginIdCreationContext - Create a new service principal using the OriginID as a reference to an existing service principal from AAD backed provider.\n\n If the service principal to be added corresponds to a service principal that was previously deleted, then that service principal will be restored.\n\n Optionally, you can add the newly created service principal as a member of an existing ADO group and/or specify a custom storage key for the service principal."] + #[doc = ""] + #[doc = "See [`create`](super::super::service_principals::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + group_descriptors: None, + } + } + #[doc = "Get a service principal by its descriptor."] + #[doc = ""] + #[doc = "See [`get`](super::super::service_principals::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + service_principal_descriptor: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + service_principal_descriptor: service_principal_descriptor.into(), + } + } + #[doc = "Disables a service principal.\n\nThe service principal will still be visible, but membership checks for the service principal will return false."] + #[doc = ""] + #[doc = "See [`delete`](super::super::service_principals::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + service_principal_descriptor: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + service_principal_descriptor: service_principal_descriptor.into(), + } + } + } + } + pub mod storage_keys { + use super::super::models; + use super::super::storage_keys::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Resolve a descriptor to a storage key."] + #[doc = ""] + #[doc = "See [`get`](super::super::storage_keys::Client::get) for details of the arguments."] + pub fn get( + &self, + subject_descriptor: impl Into, + organization: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subject_descriptor: subject_descriptor.into(), + organization: organization.into(), + } + } + } + } + pub mod subject_lookup { + use super::super::models; + use super::super::subject_lookup::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Resolve descriptors to users, groups or scopes (Subjects) in a batch."] + #[doc = ""] + #[doc = "See [`lookup_subjects`](super::super::subject_lookup::Client::lookup_subjects) for details of the arguments."] + pub fn lookup_subjects( + &self, + organization: impl Into, + body: impl Into, + ) -> lookup_subjects::RequestBuilder { + lookup_subjects::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + } + } + pub mod subject_query { + use super::super::models; + use super::super::subject_query::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Search for Azure Devops users, or/and groups. Results will be returned in a batch with no more than 100 graph subjects."] + #[doc = ""] + #[doc = "See [`query`](super::super::subject_query::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + body: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + } + } + pub mod avatars { + use super::super::avatars::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`get`](super::super::avatars::Client::get) for details of the arguments."] + pub fn get( + &self, + subject_descriptor: impl Into, + organization: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + subject_descriptor: subject_descriptor.into(), + organization: organization.into(), + size: None, + format: None, + } + } + #[doc = "See [`set_avatar`](super::super::avatars::Client::set_avatar) for details of the arguments."] + pub fn set_avatar( + &self, + body: impl Into, + subject_descriptor: impl Into, + organization: impl Into, + ) -> set_avatar::RequestBuilder { + set_avatar::RequestBuilder { + client: self.0.clone(), + body: body.into(), + subject_descriptor: subject_descriptor.into(), + organization: organization.into(), + } + } + #[doc = "See [`delete`](super::super::avatars::Client::delete) for details of the arguments."] + pub fn delete( + &self, + subject_descriptor: impl Into, + organization: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + subject_descriptor: subject_descriptor.into(), + organization: organization.into(), + } + } + } + } + pub mod users { + use super::super::models; + use super::super::users::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of all users in a given scope.\n\nSince the list of users may be large, results are returned in pages of users. If there are more results\n than can be returned in a single page, the result set will contain a continuation token for retrieval of the\n next set of results."] + #[doc = ""] + #[doc = "See [`list`](super::super::users::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subject_types: None, + continuation_token: None, + scope_descriptor: None, + } + } + #[doc = "Materialize an existing AAD or MSA user into the ADO account.\n\nNOTE: Created users are not active in an account unless they have been explicitly assigned a parent group at creation time or have signed in\n and been autolicensed through AAD group memberships.\n\n Adding a user to an account is required before the user can be added to ADO groups or assigned an asset.\n\n The body of the request must be a derived type of GraphUserCreationContext:\n * GraphUserMailAddressCreationContext - Create a new user using the mail address as a reference to an existing user from an external AD or AAD backed provider.\n * GraphUserOriginIdCreationContext - Create a new user using the OriginID as a reference to an existing user from an external AD or AAD backed provider.\n * GraphUserPrincipalNameCreationContext - Create a new user using the principal name as a reference to an existing user from an external AD or AAD backed provider.\n\n If the user to be added corresponds to a user that was previously deleted, then that user will be restored.\n\n Optionally, you can add the newly created user as a member of an existing ADO group and/or specify a custom storage key for the user."] + #[doc = ""] + #[doc = "See [`create`](super::super::users::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + group_descriptors: None, + } + } + #[doc = "Get a user by its descriptor."] + #[doc = ""] + #[doc = "See [`get`](super::super::users::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + user_descriptor: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + user_descriptor: user_descriptor.into(), + } + } + #[doc = "Map an existing user to a different user.\n\nThe body of the request must be a derived type of GraphUserUpdateContext:\n * GraphUserOriginIdUpdateContext - Map an existing user in an account, to an existing user from an external AD or AAD backed provider using the OriginId as a reference."] + #[doc = ""] + #[doc = "See [`update`](super::super::users::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + user_descriptor: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + user_descriptor: user_descriptor.into(), + } + } + #[doc = "Disables a user.\n\nThe user will still be visible, but membership checks for the user will return false."] + #[doc = ""] + #[doc = "See [`delete`](super::super::users::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + user_descriptor: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + user_descriptor: user_descriptor.into(), + } + } + } + } + pub mod provider_info { + use super::super::models; + use super::super::provider_info::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`get`](super::super::provider_info::Client::get) for details of the arguments."] + pub fn get( + &self, + user_descriptor: impl Into, + organization: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + user_descriptor: user_descriptor.into(), + organization: organization.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/hooks/mod.rs b/azure_devops_rust_api/src/hooks/mod.rs index 4f5502e3..8b03672f 100644 --- a/azure_devops_rust_api/src/hooks/mod.rs +++ b/azure_devops_rust_api/src/hooks/mod.rs @@ -254,16 +254,53 @@ pub mod consumers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) publisher_id: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn publisher_id(mut self, publisher_id: impl Into) -> Self { self.publisher_id = Some(publisher_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(publisher_id) = &this.publisher_id { + req.url_mut() + .query_pairs_mut() + .append_pair("publisherId", publisher_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -272,9 +309,7 @@ pub mod consumers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -286,29 +321,24 @@ pub mod consumers { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -358,17 +388,55 @@ pub mod consumers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) consumer_id: String, pub(crate) publisher_id: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn publisher_id(mut self, publisher_id: impl Into) -> Self { self.publisher_id = Some(publisher_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(publisher_id) = &this.publisher_id { + req.url_mut() + .query_pairs_mut() + .append_pair("publisherId", publisher_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/consumers/{}", + self.client.endpoint(), + self.organization, + self.consumer_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -377,9 +445,7 @@ pub mod consumers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -391,30 +457,24 @@ pub mod consumers { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/consumers/{}", - self.client.endpoint(), - self.organization, - self.consumer_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -464,17 +524,55 @@ pub mod consumers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) consumer_id: String, pub(crate) publisher_id: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn publisher_id(mut self, publisher_id: impl Into) -> Self { self.publisher_id = Some(publisher_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(publisher_id) = &this.publisher_id { + req.url_mut() + .query_pairs_mut() + .append_pair("publisherId", publisher_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/consumers/{}/actions", + self.client.endpoint(), + self.organization, + self.consumer_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -483,9 +581,7 @@ pub mod consumers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -497,30 +593,24 @@ pub mod consumers { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/consumers/{}/actions", - self.client.endpoint(), - self.organization, - self.consumer_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -570,18 +660,57 @@ pub mod consumers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) consumer_id: String, pub(crate) consumer_action_id: String, pub(crate) publisher_id: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn publisher_id(mut self, publisher_id: impl Into) -> Self { self.publisher_id = Some(publisher_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(publisher_id) = &this.publisher_id { + req.url_mut() + .query_pairs_mut() + .append_pair("publisherId", publisher_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/consumers/{}/actions/{}", + self.client.endpoint(), + self.organization, + self.consumer_id, + self.consumer_action_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -590,9 +719,7 @@ pub mod consumers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -604,31 +731,24 @@ pub mod consumers { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/consumers/{}/actions/{}", - self.client.endpoint(), - self.organization, - self.consumer_id, - self.consumer_action_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -756,11 +876,43 @@ pub mod notifications { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::NotificationsQuery, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -770,9 +922,7 @@ pub mod notifications { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -784,25 +934,24 @@ pub mod notifications { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -852,15 +1001,19 @@ pub mod notifications { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) subscription_id: String, pub(crate) max_results: Option, pub(crate) status: Option, pub(crate) result: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Maximum number of notifications to return. Default is **100**."] pub fn max_results(mut self, max_results: i32) -> Self { self.max_results = Some(max_results); @@ -876,6 +1029,50 @@ pub mod notifications { self.result = Some(result.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(max_results) = &this.max_results { + req.url_mut() + .query_pairs_mut() + .append_pair("maxResults", &max_results.to_string()); + } + if let Some(status) = &this.status { + req.url_mut() + .query_pairs_mut() + .append_pair("status", &status.to_string()); + } + if let Some(result) = &this.result { + req.url_mut() + .query_pairs_mut() + .append_pair("result", &result.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}/notifications", + self.client.endpoint(), + self.organization, + self.subscription_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -884,9 +1081,7 @@ pub mod notifications { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -898,40 +1093,24 @@ pub mod notifications { auth_header, ); } - if let Some(max_results) = &this.max_results { - req.url_mut() - .query_pairs_mut() - .append_pair("maxResults", &max_results.to_string()); - } - if let Some(status) = &this.status { - req.url_mut() - .query_pairs_mut() - .append_pair("status", &status.to_string()); - } - if let Some(result) = &this.result { - req.url_mut() - .query_pairs_mut() - .append_pair("result", &result.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}/notifications", - self.client.endpoint(), - self.organization, - self.subscription_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -981,12 +1160,45 @@ pub mod notifications { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) subscription_id: String, pub(crate) notification_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}/notifications/{}", + self.client.endpoint(), + self.organization, + self.subscription_id, + self.notification_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -996,9 +1208,7 @@ pub mod notifications { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1010,26 +1220,24 @@ pub mod notifications { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}/notifications/{}", - self.client.endpoint(), - self.organization, - self.subscription_id, - self.notification_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1079,29 +1287,65 @@ pub mod notifications { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Notification, pub(crate) use_real_data: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Only allow testing with real data in existing subscriptions."] pub fn use_real_data(mut self, use_real_data: bool) -> Self { self.use_real_data = Some(use_real_data); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1113,30 +1357,24 @@ pub mod notifications { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1286,10 +1524,41 @@ pub mod publishers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1299,9 +1568,7 @@ pub mod publishers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1313,24 +1580,24 @@ pub mod publishers { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1380,11 +1647,43 @@ pub mod publishers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) publisher_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/publishers/{}", + self.client.endpoint(), + self.organization, + self.publisher_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1394,9 +1693,7 @@ pub mod publishers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1408,25 +1705,24 @@ pub mod publishers { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/publishers/{}", - self.client.endpoint(), - self.organization, - self.publisher_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1479,11 +1775,43 @@ pub mod publishers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) publisher_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/publishers/{}/eventtypes", + self.client.endpoint(), + self.organization, + self.publisher_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1493,9 +1821,7 @@ pub mod publishers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1507,25 +1833,24 @@ pub mod publishers { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/publishers/{}/eventtypes", - self.client.endpoint(), - self.organization, - self.publisher_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1576,12 +1901,45 @@ pub mod publishers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) publisher_id: String, pub(crate) event_type_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/publishers/{}/eventtypes/{}", + self.client.endpoint(), + self.organization, + self.publisher_id, + self.event_type_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1591,9 +1949,7 @@ pub mod publishers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1605,26 +1961,24 @@ pub mod publishers { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/publishers/{}/eventtypes/{}", - self.client.endpoint(), - self.organization, - self.publisher_id, - self.event_type_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1674,12 +2028,45 @@ pub mod publishers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::InputValuesQuery, pub(crate) publisher_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/publishers/{}/inputValuesQuery", + self.client.endpoint(), + self.organization, + self.publisher_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1689,9 +2076,7 @@ pub mod publishers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1703,26 +2088,24 @@ pub mod publishers { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/publishers/{}/inputValuesQuery", - self.client.endpoint(), - self.organization, - self.publisher_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1772,11 +2155,43 @@ pub mod publishers { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PublishersQuery, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1786,9 +2201,7 @@ pub mod publishers { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1800,25 +2213,24 @@ pub mod publishers { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1972,15 +2384,19 @@ pub mod subscriptions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) publisher_id: Option, pub(crate) event_type: Option, pub(crate) consumer_id: Option, pub(crate) consumer_action_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "ID for a subscription."] pub fn publisher_id(mut self, publisher_id: impl Into) -> Self { self.publisher_id = Some(publisher_id.into()); @@ -2001,6 +2417,54 @@ pub mod subscriptions { self.consumer_action_id = Some(consumer_action_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(publisher_id) = &this.publisher_id { + req.url_mut() + .query_pairs_mut() + .append_pair("publisherId", publisher_id); + } + if let Some(event_type) = &this.event_type { + req.url_mut() + .query_pairs_mut() + .append_pair("eventType", event_type); + } + if let Some(consumer_id) = &this.consumer_id { + req.url_mut() + .query_pairs_mut() + .append_pair("consumerId", consumer_id); + } + if let Some(consumer_action_id) = &this.consumer_action_id { + req.url_mut() + .query_pairs_mut() + .append_pair("consumerActionId", consumer_action_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2009,9 +2473,7 @@ pub mod subscriptions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2023,44 +2485,24 @@ pub mod subscriptions { auth_header, ); } - if let Some(publisher_id) = &this.publisher_id { - req.url_mut() - .query_pairs_mut() - .append_pair("publisherId", publisher_id); - } - if let Some(event_type) = &this.event_type { - req.url_mut() - .query_pairs_mut() - .append_pair("eventType", event_type); - } - if let Some(consumer_id) = &this.consumer_id { - req.url_mut() - .query_pairs_mut() - .append_pair("consumerId", consumer_id); - } - if let Some(consumer_action_id) = &this.consumer_action_id { - req.url_mut() - .query_pairs_mut() - .append_pair("consumerActionId", consumer_action_id); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2110,11 +2552,43 @@ pub mod subscriptions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Subscription, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2124,9 +2598,7 @@ pub mod subscriptions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2138,25 +2610,24 @@ pub mod subscriptions { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2206,11 +2677,43 @@ pub mod subscriptions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) subscription_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}", + self.client.endpoint(), + self.organization, + self.subscription_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2220,9 +2723,7 @@ pub mod subscriptions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2234,25 +2735,24 @@ pub mod subscriptions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}", - self.client.endpoint(), - self.organization, - self.subscription_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2302,12 +2802,45 @@ pub mod subscriptions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Subscription, pub(crate) subscription_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}", + self.client.endpoint(), + self.organization, + self.subscription_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2317,9 +2850,7 @@ pub mod subscriptions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2331,26 +2862,24 @@ pub mod subscriptions { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}", - self.client.endpoint(), - self.organization, - self.subscription_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2395,11 +2924,43 @@ pub mod subscriptions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) subscription_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}", + self.client.endpoint(), + self.organization, + self.subscription_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2409,9 +2970,7 @@ pub mod subscriptions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2423,25 +2982,24 @@ pub mod subscriptions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}", - self.client.endpoint(), - self.organization, - self.subscription_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2494,11 +3052,43 @@ pub mod subscriptions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::SubscriptionsQuery, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2508,9 +3098,7 @@ pub mod subscriptions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2522,25 +3110,24 @@ pub mod subscriptions { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2631,11 +3218,43 @@ pub mod diagnostics { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) subscription_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}/diagnostics", + self.client.endpoint(), + self.organization, + self.subscription_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2645,9 +3264,7 @@ pub mod diagnostics { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2659,25 +3276,24 @@ pub mod diagnostics { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}/diagnostics", - self.client.endpoint(), - self.organization, - self.subscription_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2731,12 +3347,45 @@ pub mod diagnostics { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UpdateSubscripitonDiagnosticsParameters, pub(crate) subscription_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/hooks/subscriptions/{}/diagnostics", + self.client.endpoint(), + self.organization, + self.subscription_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2746,9 +3395,7 @@ pub mod diagnostics { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2760,26 +3407,24 @@ pub mod diagnostics { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/hooks/subscriptions/{}/diagnostics", - self.client.endpoint(), - self.organization, - self.subscription_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2797,3 +3442,452 @@ pub mod diagnostics { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn consumers_client(&self) -> consumers::Client { + consumers::Client(self.clone()) + } + pub fn diagnostics_client(&self) -> diagnostics::Client { + diagnostics::Client(self.clone()) + } + pub fn notifications_client(&self) -> notifications::Client { + notifications::Client(self.clone()) + } + pub fn publishers_client(&self) -> publishers::Client { + publishers::Client(self.clone()) + } + pub fn subscriptions_client(&self) -> subscriptions::Client { + subscriptions::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod consumers { + use super::super::consumers::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of available service hook consumer services. Optionally filter by consumers that support at least one event type from the specific publisher."] + #[doc = ""] + #[doc = "See [`list`](super::super::consumers::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + publisher_id: None, + } + } + #[doc = "Get a specific consumer service. Optionally filter out consumer actions that do not support any event types for the specified publisher."] + #[doc = ""] + #[doc = "See [`get`](super::super::consumers::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + consumer_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + consumer_id: consumer_id.into(), + publisher_id: None, + } + } + #[doc = "Get a list of consumer actions for a specific consumer."] + #[doc = ""] + #[doc = "See [`list_consumer_actions`](super::super::consumers::Client::list_consumer_actions) for details of the arguments."] + pub fn list_consumer_actions( + &self, + organization: impl Into, + consumer_id: impl Into, + ) -> list_consumer_actions::RequestBuilder { + list_consumer_actions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + consumer_id: consumer_id.into(), + publisher_id: None, + } + } + #[doc = "Get details about a specific consumer action."] + #[doc = ""] + #[doc = "See [`get_consumer_action`](super::super::consumers::Client::get_consumer_action) for details of the arguments."] + pub fn get_consumer_action( + &self, + organization: impl Into, + consumer_id: impl Into, + consumer_action_id: impl Into, + ) -> get_consumer_action::RequestBuilder { + get_consumer_action::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + consumer_id: consumer_id.into(), + consumer_action_id: consumer_action_id.into(), + publisher_id: None, + } + } + } + } + pub mod notifications { + use super::super::models; + use super::super::notifications::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Query for notifications. A notification includes details about the event, the request to and the response from the consumer service."] + #[doc = ""] + #[doc = "See [`query`](super::super::notifications::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + body: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Get a list of notifications for a specific subscription. A notification includes details about the event, the request to and the response from the consumer service."] + #[doc = ""] + #[doc = "See [`list`](super::super::notifications::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + subscription_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subscription_id: subscription_id.into(), + max_results: None, + status: None, + result: None, + } + } + #[doc = "Get a specific notification for a subscription."] + #[doc = ""] + #[doc = "See [`get`](super::super::notifications::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + subscription_id: impl Into, + notification_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subscription_id: subscription_id.into(), + notification_id, + } + } + #[doc = "Sends a test notification. This is useful for verifying the configuration of an updated or new service hooks subscription."] + #[doc = ""] + #[doc = "See [`create`](super::super::notifications::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + use_real_data: None, + } + } + } + } + pub mod publishers { + use super::super::models; + use super::super::publishers::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of publishers."] + #[doc = ""] + #[doc = "See [`list`](super::super::publishers::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Get a specific service hooks publisher."] + #[doc = ""] + #[doc = "See [`get`](super::super::publishers::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + publisher_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + publisher_id: publisher_id.into(), + } + } + #[doc = "Get the event types for a specific publisher."] + #[doc = ""] + #[doc = "See [`list_event_types`](super::super::publishers::Client::list_event_types) for details of the arguments."] + pub fn list_event_types( + &self, + organization: impl Into, + publisher_id: impl Into, + ) -> list_event_types::RequestBuilder { + list_event_types::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + publisher_id: publisher_id.into(), + } + } + #[doc = "Get a specific event type."] + #[doc = ""] + #[doc = "See [`get_event_type`](super::super::publishers::Client::get_event_type) for details of the arguments."] + pub fn get_event_type( + &self, + organization: impl Into, + publisher_id: impl Into, + event_type_id: impl Into, + ) -> get_event_type::RequestBuilder { + get_event_type::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + publisher_id: publisher_id.into(), + event_type_id: event_type_id.into(), + } + } + #[doc = "See [`query_input_values`](super::super::publishers::Client::query_input_values) for details of the arguments."] + pub fn query_input_values( + &self, + organization: impl Into, + body: impl Into, + publisher_id: impl Into, + ) -> query_input_values::RequestBuilder { + query_input_values::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + publisher_id: publisher_id.into(), + } + } + #[doc = "Query for service hook publishers."] + #[doc = ""] + #[doc = "See [`query_publishers`](super::super::publishers::Client::query_publishers) for details of the arguments."] + pub fn query_publishers( + &self, + organization: impl Into, + body: impl Into, + ) -> query_publishers::RequestBuilder { + query_publishers::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + } + } + pub mod subscriptions { + use super::super::models; + use super::super::subscriptions::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of subscriptions."] + #[doc = ""] + #[doc = "See [`list`](super::super::subscriptions::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + publisher_id: None, + event_type: None, + consumer_id: None, + consumer_action_id: None, + } + } + #[doc = "Create a subscription."] + #[doc = ""] + #[doc = "See [`create`](super::super::subscriptions::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Get a specific service hooks subscription."] + #[doc = ""] + #[doc = "See [`get`](super::super::subscriptions::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Update a subscription. ID for a subscription that you wish to update."] + #[doc = ""] + #[doc = "See [`replace_subscription`](super::super::subscriptions::Client::replace_subscription) for details of the arguments."] + pub fn replace_subscription( + &self, + organization: impl Into, + body: impl Into, + subscription_id: impl Into, + ) -> replace_subscription::RequestBuilder { + replace_subscription::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Delete a specific service hooks subscription."] + #[doc = ""] + #[doc = "See [`delete`](super::super::subscriptions::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + subscription_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "Query for service hook subscriptions."] + #[doc = ""] + #[doc = "See [`create_subscriptions_query`](super::super::subscriptions::Client::create_subscriptions_query) for details of the arguments."] + pub fn create_subscriptions_query( + &self, + organization: impl Into, + body: impl Into, + ) -> create_subscriptions_query::RequestBuilder { + create_subscriptions_query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + } + } + pub mod diagnostics { + use super::super::diagnostics::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`get`](super::super::diagnostics::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + subscription_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subscription_id: subscription_id.into(), + } + } + #[doc = "See [`update`](super::super::diagnostics::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + subscription_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + subscription_id: subscription_id.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/ims/mod.rs b/azure_devops_rust_api/src/ims/mod.rs index 56b9b8d0..5e788f38 100644 --- a/azure_devops_rust_api/src/ims/mod.rs +++ b/azure_devops_rust_api/src/ims/mod.rs @@ -196,8 +196,12 @@ pub mod identities { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) descriptors: Option, pub(crate) identity_ids: Option, @@ -206,7 +210,7 @@ pub mod identities { pub(crate) filter_value: Option, pub(crate) query_membership: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A comma separated list of identity descriptors to resolve"] pub fn descriptors(mut self, descriptors: impl Into) -> Self { self.descriptors = Some(descriptors.into()); @@ -240,6 +244,64 @@ pub mod identities { self.query_membership = Some(query_membership.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(descriptors) = &this.descriptors { + req.url_mut() + .query_pairs_mut() + .append_pair("descriptors", descriptors); + } + if let Some(identity_ids) = &this.identity_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("identityIds", identity_ids); + } + if let Some(subject_descriptors) = &this.subject_descriptors { + req.url_mut() + .query_pairs_mut() + .append_pair("subjectDescriptors", subject_descriptors); + } + if let Some(search_filter) = &this.search_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("searchFilter", search_filter); + } + if let Some(filter_value) = &this.filter_value { + req.url_mut() + .query_pairs_mut() + .append_pair("filterValue", filter_value); + } + if let Some(query_membership) = &this.query_membership { + req.url_mut() + .query_pairs_mut() + .append_pair("queryMembership", &query_membership.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -248,9 +310,7 @@ pub mod identities { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -262,54 +322,24 @@ pub mod identities { auth_header, ); } - if let Some(descriptors) = &this.descriptors { - req.url_mut() - .query_pairs_mut() - .append_pair("descriptors", descriptors); - } - if let Some(identity_ids) = &this.identity_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("identityIds", identity_ids); - } - if let Some(subject_descriptors) = &this.subject_descriptors { - req.url_mut() - .query_pairs_mut() - .append_pair("subjectDescriptors", subject_descriptors); - } - if let Some(search_filter) = &this.search_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("searchFilter", search_filter); - } - if let Some(filter_value) = &this.filter_value { - req.url_mut() - .query_pairs_mut() - .append_pair("filterValue", filter_value); - } - if let Some(query_membership) = &this.query_membership { - req.url_mut() - .query_pairs_mut() - .append_pair("queryMembership", &query_membership.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -326,3 +356,110 @@ pub mod identities { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn identities_client(&self) -> identities::Client { + identities::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod identities { + use super::super::identities::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Resolve legacy identity information for use with older APIs such as the Security APIs"] + #[doc = ""] + #[doc = "See [`read_identities`](super::super::identities::Client::read_identities) for details of the arguments."] + pub fn read_identities( + &self, + organization: impl Into, + ) -> read_identities::RequestBuilder { + read_identities::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + descriptors: None, + identity_ids: None, + subject_descriptors: None, + search_filter: None, + filter_value: None, + query_membership: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/lib.rs b/azure_devops_rust_api/src/lib.rs index a28e402d..cbf9df1c 100644 --- a/azure_devops_rust_api/src/lib.rs +++ b/azure_devops_rust_api/src/lib.rs @@ -137,6 +137,16 @@ pub mod work; mod auth; pub use auth::Credential; +#[cfg(feature = "blocking")] +pub mod blocking; + +/// Access to a client's endpoint, used by request builders that are shared by +/// async and blocking clients. +#[doc(hidden)] +pub trait ClientEndpoint { + fn endpoint(&self) -> &azure_core::http::Url; +} + pub mod date_time; pub mod headers; pub mod telemetry; 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 92fdd571..c9b3b09b 100644 --- a/azure_devops_rust_api/src/member_entitlement_management/mod.rs +++ b/azure_devops_rust_api/src/member_entitlement_management/mod.rs @@ -273,10 +273,41 @@ pub mod group_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -286,9 +317,7 @@ pub mod group_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -300,24 +329,24 @@ pub mod group_entitlements { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -372,18 +401,56 @@ pub mod group_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GroupEntitlement, pub(crate) rule_option: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "RuleOption [ApplyGroupRule/TestApplyGroupRule] - specifies if the rules defined in group entitlement should be created and applied to it’s members (default option) or just be tested"] pub fn rule_option(mut self, rule_option: impl Into) -> Self { self.rule_option = Some(rule_option.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -392,9 +459,7 @@ pub mod group_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -406,30 +471,24 @@ pub mod group_entitlements { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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.to_string()); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -480,11 +539,43 @@ pub mod group_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) group_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/groupentitlements/{}", + self.client.endpoint(), + self.organization, + self.group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -494,9 +585,7 @@ pub mod group_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -508,25 +597,24 @@ pub mod group_entitlements { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/groupentitlements/{}", - self.client.endpoint(), - self.organization, - self.group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -581,19 +669,58 @@ pub mod group_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::JsonPatchDocument, pub(crate) group_id: String, pub(crate) rule_option: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "RuleOption [ApplyGroupRule/TestApplyGroupRule] - specifies if the rules defined in group entitlement should be updated and the changes are applied to it’s members (default option) or just be tested"] pub fn rule_option(mut self, rule_option: impl Into) -> Self { self.rule_option = Some(rule_option.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + 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.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/groupentitlements/{}", + self.client.endpoint(), + self.organization, + self.group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -602,9 +729,7 @@ pub mod group_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -616,31 +741,24 @@ pub mod group_entitlements { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - 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.to_string()); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/groupentitlements/{}", - self.client.endpoint(), - self.organization, - self.group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -696,14 +814,18 @@ pub mod group_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) group_id: String, pub(crate) rule_option: Option, pub(crate) remove_group_membership: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "RuleOption [ApplyGroupRule/TestApplyGroupRule] - specifies if the rules defined in group entitlement should be deleted and the changes are applied to it’s members (default option) or just be tested"] pub fn rule_option(mut self, rule_option: impl Into) -> Self { self.rule_option = Some(rule_option.into()); @@ -714,6 +836,46 @@ pub mod group_entitlements { self.remove_group_membership = Some(remove_group_membership); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + if let Some(rule_option) = &this.rule_option { + req.url_mut() + .query_pairs_mut() + .append_pair("ruleOption", &rule_option.to_string()); + } + if let Some(remove_group_membership) = &this.remove_group_membership { + req.url_mut().query_pairs_mut().append_pair( + "removeGroupMembership", + &remove_group_membership.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/groupentitlements/{}", + self.client.endpoint(), + self.organization, + self.group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -722,9 +884,7 @@ pub mod group_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -736,36 +896,24 @@ pub mod group_entitlements { auth_header, ); } - if let Some(rule_option) = &this.rule_option { - req.url_mut() - .query_pairs_mut() - .append_pair("ruleOption", &rule_option.to_string()); - } - if let Some(remove_group_membership) = &this.remove_group_membership { - req.url_mut().query_pairs_mut().append_pair( - "removeGroupMembership", - &remove_group_membership.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/groupentitlements/{}", - self.client.endpoint(), - self.organization, - self.group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -882,14 +1030,18 @@ pub mod members { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) group_id: String, pub(crate) max_results: Option, pub(crate) paging_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Maximum number of results to retrieve."] pub fn max_results(mut self, max_results: i32) -> Self { self.max_results = Some(max_results); @@ -900,6 +1052,45 @@ pub mod members { self.paging_token = Some(paging_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(max_results) = &this.max_results { + req.url_mut() + .query_pairs_mut() + .append_pair("maxResults", &max_results.to_string()); + } + if let Some(paging_token) = &this.paging_token { + req.url_mut() + .query_pairs_mut() + .append_pair("pagingToken", paging_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/GroupEntitlements/{}/members", + self.client.endpoint(), + self.organization, + self.group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -908,9 +1099,7 @@ pub mod members { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -922,35 +1111,24 @@ pub mod members { auth_header, ); } - if let Some(max_results) = &this.max_results { - req.url_mut() - .query_pairs_mut() - .append_pair("maxResults", &max_results.to_string()); - } - if let Some(paging_token) = &this.paging_token { - req.url_mut() - .query_pairs_mut() - .append_pair("pagingToken", paging_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/GroupEntitlements/{}/members", - self.client.endpoint(), - self.organization, - self.group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -995,12 +1173,45 @@ pub mod members { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) group_id: String, pub(crate) member_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/GroupEntitlements/{}/members/{}", + self.client.endpoint(), + self.organization, + self.group_id, + self.member_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1010,9 +1221,7 @@ pub mod members { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1024,26 +1233,24 @@ pub mod members { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/GroupEntitlements/{}/members/{}", - self.client.endpoint(), - self.organization, - self.group_id, - self.member_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1091,40 +1298,28 @@ pub mod members { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) group_id: String, pub(crate) member_id: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -1142,6 +1337,47 @@ pub mod members { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result<()>; type IntoFuture = BoxFuture<'static, azure_core::Result<()>>; @@ -1217,15 +1453,19 @@ pub mod member_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) continuation_token: Option, pub(crate) select: Option, pub(crate) filter: Option, pub(crate) order_by: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { self.continuation_token = Some(continuation_token.into()); self @@ -1242,6 +1482,54 @@ pub mod member_entitlements { self.order_by = Some(order_by.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(select) = &this.select { + req.url_mut() + .query_pairs_mut() + .append_pair("select", &select.to_string()); + } + if let Some(filter) = &this.filter { + req.url_mut() + .query_pairs_mut() + .append_pair("$filter", filter); + } + if let Some(order_by) = &this.order_by { + req.url_mut() + .query_pairs_mut() + .append_pair("$orderBy", order_by); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1250,9 +1538,7 @@ pub mod member_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1264,44 +1550,24 @@ pub mod member_entitlements { auth_header, ); } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(select) = &this.select { - req.url_mut() - .query_pairs_mut() - .append_pair("select", &select.to_string()); - } - if let Some(filter) = &this.filter { - req.url_mut() - .query_pairs_mut() - .append_pair("$filter", filter); - } - if let Some(order_by) = &this.order_by { - req.url_mut() - .query_pairs_mut() - .append_pair("$orderBy", order_by); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1449,11 +1715,43 @@ pub mod service_principal_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ServicePrincipalEntitlement, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1463,9 +1761,7 @@ pub mod service_principal_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1477,25 +1773,24 @@ pub mod service_principal_entitlements { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1554,11 +1849,43 @@ pub mod service_principal_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::JsonPatchDocument, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1568,9 +1895,7 @@ pub mod service_principal_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1582,25 +1907,24 @@ pub mod service_principal_entitlements { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1656,11 +1980,43 @@ pub mod service_principal_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) service_principal_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/serviceprincipalentitlements/{}", + self.client.endpoint(), + self.organization, + self.service_principal_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1670,9 +2026,7 @@ pub mod service_principal_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1684,25 +2038,24 @@ pub mod service_principal_entitlements { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/serviceprincipalentitlements/{}", - self.client.endpoint(), - self.organization, - self.service_principal_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1758,12 +2111,45 @@ pub mod service_principal_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::JsonPatchDocument, pub(crate) service_principal_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/serviceprincipalentitlements/{}", + self.client.endpoint(), + self.organization, + self.service_principal_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1773,9 +2159,7 @@ pub mod service_principal_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1787,26 +2171,24 @@ pub mod service_principal_entitlements { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/serviceprincipalentitlements/{}", - self.client.endpoint(), - self.organization, - self.service_principal_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1854,11 +2236,43 @@ pub mod service_principal_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) service_principal_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/serviceprincipalentitlements/{}", + self.client.endpoint(), + self.organization, + self.service_principal_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1868,9 +2282,7 @@ pub mod service_principal_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1882,25 +2294,24 @@ pub mod service_principal_entitlements { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/serviceprincipalentitlements/{}", - self.client.endpoint(), - self.organization, - self.service_principal_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2067,15 +2478,19 @@ pub mod user_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) continuation_token: Option, pub(crate) select: Option, pub(crate) filter: Option, pub(crate) order_by: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Continuation token for getting the next page of data set. If null is passed, gets the first page."] pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { self.continuation_token = Some(continuation_token.into()); @@ -2096,6 +2511,54 @@ pub mod user_entitlements { self.order_by = Some(order_by.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(select) = &this.select { + req.url_mut() + .query_pairs_mut() + .append_pair("select", &select.to_string()); + } + if let Some(filter) = &this.filter { + req.url_mut() + .query_pairs_mut() + .append_pair("$filter", filter); + } + if let Some(order_by) = &this.order_by { + req.url_mut() + .query_pairs_mut() + .append_pair("$orderBy", order_by); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2104,9 +2567,7 @@ pub mod user_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2118,44 +2579,24 @@ pub mod user_entitlements { auth_header, ); } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(select) = &this.select { - req.url_mut() - .query_pairs_mut() - .append_pair("select", &select.to_string()); - } - if let Some(filter) = &this.filter { - req.url_mut() - .query_pairs_mut() - .append_pair("$filter", filter); - } - if let Some(order_by) = &this.order_by { - req.url_mut() - .query_pairs_mut() - .append_pair("$orderBy", order_by); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2209,11 +2650,43 @@ pub mod user_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UserEntitlement, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2223,9 +2696,7 @@ pub mod user_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2237,25 +2708,24 @@ pub mod user_entitlements { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2311,13 +2781,17 @@ pub mod user_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::JsonPatchDocument, pub(crate) do_not_send_invite_for_new_users: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Whether to send email invites to new users or not"] pub fn do_not_send_invite_for_new_users( mut self, @@ -2326,6 +2800,43 @@ pub mod user_entitlements { self.do_not_send_invite_for_new_users = Some(do_not_send_invite_for_new_users); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + 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 + { + req.url_mut().query_pairs_mut().append_pair( + "doNotSendInviteForNewUsers", + &do_not_send_invite_for_new_users.to_string(), + ); + } + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2334,9 +2845,7 @@ pub mod user_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2348,33 +2857,24 @@ pub mod user_entitlements { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - 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 - { - req.url_mut().query_pairs_mut().append_pair( - "doNotSendInviteForNewUsers", - &do_not_send_invite_for_new_users.to_string(), - ); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2425,11 +2925,43 @@ pub mod user_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) user_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/userentitlements/{}", + self.client.endpoint(), + self.organization, + self.user_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2439,9 +2971,7 @@ pub mod user_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2453,25 +2983,24 @@ pub mod user_entitlements { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/userentitlements/{}", - self.client.endpoint(), - self.organization, - self.user_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2524,12 +3053,45 @@ pub mod user_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::JsonPatchDocument, pub(crate) user_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/userentitlements/{}", + self.client.endpoint(), + self.organization, + self.user_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2539,9 +3101,7 @@ pub mod user_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2553,26 +3113,24 @@ pub mod user_entitlements { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/userentitlements/{}", - self.client.endpoint(), - self.organization, - self.user_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2618,11 +3176,43 @@ pub mod user_entitlements { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) user_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/userentitlements/{}", + self.client.endpoint(), + self.organization, + self.user_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2632,9 +3222,7 @@ pub mod user_entitlements { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2646,25 +3234,24 @@ pub mod user_entitlements { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/userentitlements/{}", - self.client.endpoint(), - self.organization, - self.user_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2738,17 +3325,54 @@ pub mod user_entitlement_summary { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) select: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Comma (\",\") separated list of properties to select. Supported property names are {AccessLevels, Licenses, Projects, Groups}."] pub fn select(mut self, select: impl Into) -> Self { self.select = Some(select.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(select) = &this.select { + req.url_mut() + .query_pairs_mut() + .append_pair("select", select); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2757,9 +3381,7 @@ pub mod user_entitlement_summary { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2771,29 +3393,24 @@ pub mod user_entitlement_summary { auth_header, ); } - if let Some(select) = &this.select { - req.url_mut() - .query_pairs_mut() - .append_pair("select", select); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2810,3 +3427,454 @@ pub mod user_entitlement_summary { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn group_entitlements_client(&self) -> group_entitlements::Client { + group_entitlements::Client(self.clone()) + } + pub fn member_entitlements_client(&self) -> member_entitlements::Client { + member_entitlements::Client(self.clone()) + } + pub fn members_client(&self) -> members::Client { + members::Client(self.clone()) + } + pub fn service_principal_entitlements_client( + &self, + ) -> service_principal_entitlements::Client { + service_principal_entitlements::Client(self.clone()) + } + pub fn user_entitlement_summary_client(&self) -> user_entitlement_summary::Client { + user_entitlement_summary::Client(self.clone()) + } + pub fn user_entitlements_client(&self) -> user_entitlements::Client { + user_entitlements::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod group_entitlements { + use super::super::group_entitlements::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the group entitlements for an account."] + #[doc = ""] + #[doc = "See [`list`](super::super::group_entitlements::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Create a group entitlement with license rule, extension rule."] + #[doc = ""] + #[doc = "See [`add`](super::super::group_entitlements::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + rule_option: None, + } + } + #[doc = "Get a group entitlement.\n\nIf the group entitlement does not exist, returns null."] + #[doc = ""] + #[doc = "See [`get`](super::super::group_entitlements::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + group_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + group_id: group_id.into(), + } + } + #[doc = "Update entitlements (License Rule, Extensions Rule, Project memberships etc.) for a group."] + #[doc = ""] + #[doc = "See [`update`](super::super::group_entitlements::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + group_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + group_id: group_id.into(), + rule_option: None, + } + } + #[doc = "Delete a group entitlement."] + #[doc = ""] + #[doc = "See [`delete`](super::super::group_entitlements::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + group_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + group_id: group_id.into(), + rule_option: None, + remove_group_membership: None, + } + } + } + } + pub mod members { + use super::super::members::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get direct members of a Group."] + #[doc = ""] + #[doc = "See [`get`](super::super::members::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + group_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + group_id: group_id.into(), + max_results: None, + paging_token: None, + } + } + #[doc = "Add a member to a Group."] + #[doc = ""] + #[doc = "See [`add`](super::super::members::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + group_id: impl Into, + member_id: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + group_id: group_id.into(), + member_id: member_id.into(), + } + } + #[doc = "Remove a member from a Group."] + #[doc = ""] + #[doc = "See [`remove_member_from_group`](super::super::members::Client::remove_member_from_group) for details of the arguments."] + pub fn remove_member_from_group( + &self, + organization: impl Into, + group_id: impl Into, + member_id: impl Into, + ) -> remove_member_from_group::RequestBuilder { + remove_member_from_group::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + group_id: group_id.into(), + member_id: member_id.into(), + } + } + } + } + pub mod member_entitlements { + use super::super::member_entitlements::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`search_member_entitlements`](super::super::member_entitlements::Client::search_member_entitlements) for details of the arguments."] + pub fn search_member_entitlements( + &self, + organization: impl Into, + ) -> search_member_entitlements::RequestBuilder { + search_member_entitlements::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + continuation_token: None, + select: None, + filter: None, + order_by: None, + } + } + } + } + pub mod service_principal_entitlements { + use super::super::models; + use super::super::service_principal_entitlements::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Add a service principal, assign license and extensions and make them a member of a project group in an account.\n\nNOTE: If you are working with AAD app registration, you can find service principal of your app\nin enterprise applications, and make sure to use service principal's object id as originId parameter\nin the request body"] + #[doc = ""] + #[doc = "See [`add`](super::super::service_principal_entitlements::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Edit the entitlements (License, Extensions, Projects, Teams etc) for one or more service principals."] + #[doc = ""] + #[doc = "See [`update_service_principal_entitlements`](super::super::service_principal_entitlements::Client::update_service_principal_entitlements) for details of the arguments."] + pub fn update_service_principal_entitlements( + &self, + organization: impl Into, + body: impl Into, + ) -> update_service_principal_entitlements::RequestBuilder { + update_service_principal_entitlements::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Get Service principal Entitlement for a service principal."] + #[doc = ""] + #[doc = "See [`get`](super::super::service_principal_entitlements::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + service_principal_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + service_principal_id: service_principal_id.into(), + } + } + #[doc = "Edit the entitlements (License, Extensions, Projects, Teams etc) for a service principal."] + #[doc = ""] + #[doc = "See [`update_service_principal_entitlement`](super::super::service_principal_entitlements::Client::update_service_principal_entitlement) for details of the arguments."] + pub fn update_service_principal_entitlement( + &self, + organization: impl Into, + body: impl Into, + service_principal_id: impl Into, + ) -> update_service_principal_entitlement::RequestBuilder { + update_service_principal_entitlement::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + service_principal_id: service_principal_id.into(), + } + } + #[doc = "Delete a service principal from the account.\n\nThe delete operation includes unassigning Extensions and Licenses and removing the service principal from all project memberships.\nThe service principal would continue to have access to the account if it is member of an AAD group, that is added directly to the account."] + #[doc = ""] + #[doc = "See [`delete`](super::super::service_principal_entitlements::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + service_principal_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + service_principal_id: service_principal_id.into(), + } + } + } + } + pub mod user_entitlements { + use super::super::models; + use super::super::user_entitlements::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a paged set of user entitlements matching the filter and sort criteria built with properties that match the select input."] + #[doc = ""] + #[doc = "See [`search_user_entitlements`](super::super::user_entitlements::Client::search_user_entitlements) for details of the arguments."] + pub fn search_user_entitlements( + &self, + organization: impl Into, + ) -> search_user_entitlements::RequestBuilder { + search_user_entitlements::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + continuation_token: None, + select: None, + filter: None, + order_by: None, + } + } + #[doc = "Add a user, assign license and extensions and make them a member of a project group in an account."] + #[doc = ""] + #[doc = "See [`add`](super::super::user_entitlements::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Edit the entitlements (License, Extensions, Projects, Teams etc) for one or more users."] + #[doc = ""] + #[doc = "See [`update_user_entitlements`](super::super::user_entitlements::Client::update_user_entitlements) for details of the arguments."] + pub fn update_user_entitlements( + &self, + organization: impl Into, + body: impl Into, + ) -> update_user_entitlements::RequestBuilder { + update_user_entitlements::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + do_not_send_invite_for_new_users: None, + } + } + #[doc = "Get User Entitlement for a user."] + #[doc = ""] + #[doc = "See [`get`](super::super::user_entitlements::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + user_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + user_id: user_id.into(), + } + } + #[doc = "Edit the entitlements (License, Extensions, Projects, Teams etc) for a user."] + #[doc = ""] + #[doc = "See [`update_user_entitlement`](super::super::user_entitlements::Client::update_user_entitlement) for details of the arguments."] + pub fn update_user_entitlement( + &self, + organization: impl Into, + body: impl Into, + user_id: impl Into, + ) -> update_user_entitlement::RequestBuilder { + update_user_entitlement::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + user_id: user_id.into(), + } + } + #[doc = "Delete a user from the account.\n\nThe delete operation includes unassigning Extensions and Licenses and removing the user from all project memberships.\nThe user would continue to have access to the account if she is member of an AAD group, that is added directly to the account."] + #[doc = ""] + #[doc = "See [`delete`](super::super::user_entitlements::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + user_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + user_id: user_id.into(), + } + } + } + } + pub mod user_entitlement_summary { + use super::super::models; + use super::super::user_entitlement_summary::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get summary of Licenses, Extension, Projects, Groups and their assignments in the collection."] + #[doc = ""] + #[doc = "See [`get`](super::super::user_entitlement_summary::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + select: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/operations/mod.rs b/azure_devops_rust_api/src/operations/mod.rs index 8a1f4524..2d51823e 100644 --- a/azure_devops_rust_api/src/operations/mod.rs +++ b/azure_devops_rust_api/src/operations/mod.rs @@ -194,18 +194,56 @@ pub mod operations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) operation_id: String, pub(crate) organization: String, pub(crate) plugin_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The ID for the plugin."] pub fn plugin_id(mut self, plugin_id: impl Into) -> Self { self.plugin_id = Some(plugin_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(plugin_id) = &this.plugin_id { + req.url_mut() + .query_pairs_mut() + .append_pair("pluginId", plugin_id); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/operations/{}", + self.client.endpoint(), + self.organization, + self.operation_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -214,9 +252,7 @@ pub mod operations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -228,30 +264,24 @@ pub mod operations { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/operations/{}", - self.client.endpoint(), - self.organization, - self.operation_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -268,3 +298,107 @@ pub mod operations { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn operations_client(&self) -> operations::Client { + operations::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod operations { + use super::super::models; + use super::super::operations::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets an operation from the operationId using the given pluginId.\n\nSome scenarios don’t require a pluginId. If a pluginId is not included in the call then just the operationId will be used to find an operation."] + #[doc = ""] + #[doc = "See [`get`](super::super::operations::Client::get) for details of the arguments."] + pub fn get( + &self, + operation_id: impl Into, + organization: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + operation_id: operation_id.into(), + organization: organization.into(), + plugin_id: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/permissions_report/mod.rs b/azure_devops_rust_api/src/permissions_report/mod.rs index 04c0236c..bec9eb3e 100644 --- a/azure_devops_rust_api/src/permissions_report/mod.rs +++ b/azure_devops_rust_api/src/permissions_report/mod.rs @@ -222,10 +222,41 @@ pub mod permissions_report { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -235,9 +266,7 @@ pub mod permissions_report { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -249,24 +278,24 @@ pub mod permissions_report { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -316,11 +345,43 @@ pub mod permissions_report { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PermissionsReportRequest, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -330,9 +391,7 @@ pub mod permissions_report { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -344,25 +403,24 @@ pub mod permissions_report { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -412,11 +470,43 @@ pub mod permissions_report { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/permissionsreport/{}", + self.client.endpoint(), + self.organization, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -426,9 +516,7 @@ pub mod permissions_report { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -440,25 +528,24 @@ pub mod permissions_report { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/permissionsreport/{}", - self.client.endpoint(), - self.organization, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -532,11 +619,43 @@ pub mod permissions_report_download { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/permissionsreport/{}/download", + self.client.endpoint(), + self.organization, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -546,9 +665,7 @@ pub mod permissions_report_download { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -560,25 +677,24 @@ pub mod permissions_report_download { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/permissionsreport/{}/download", - self.client.endpoint(), - self.organization, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -595,3 +711,156 @@ pub mod permissions_report_download { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn permissions_report_client(&self) -> permissions_report::Client { + permissions_report::Client(self.clone()) + } + pub fn permissions_report_download_client(&self) -> permissions_report_download::Client { + permissions_report_download::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod permissions_report { + use super::super::models; + use super::super::permissions_report::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of permissions reports"] + #[doc = ""] + #[doc = "See [`list`](super::super::permissions_report::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Request a permissions report to be created asyncronously"] + #[doc = ""] + #[doc = "See [`create`](super::super::permissions_report::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Get a specific permissions report"] + #[doc = ""] + #[doc = "See [`get`](super::super::permissions_report::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id: id.into(), + } + } + } + } + pub mod permissions_report_download { + use super::super::models; + use super::super::permissions_report_download::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Download the json results of a permissions report"] + #[doc = ""] + #[doc = "See [`download`](super::super::permissions_report_download::Client::download) for details of the arguments."] + pub fn download( + &self, + organization: impl Into, + id: impl Into, + ) -> download::RequestBuilder { + download::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id: id.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/pipelines/mod.rs b/azure_devops_rust_api/src/pipelines/mod.rs index 5605ffcb..edf6d1f3 100644 --- a/azure_devops_rust_api/src/pipelines/mod.rs +++ b/azure_devops_rust_api/src/pipelines/mod.rs @@ -247,15 +247,19 @@ pub mod pipelines { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) order_by: Option, pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A sort expression. Defaults to \"name asc\""] pub fn order_by(mut self, order_by: impl Into) -> Self { self.order_by = Some(order_by.into()); @@ -271,6 +275,50 @@ pub mod pipelines { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(order_by) = &this.order_by { + req.url_mut() + .query_pairs_mut() + .append_pair("orderBy", order_by); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -279,9 +327,7 @@ pub mod pipelines { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -293,40 +339,24 @@ pub mod pipelines { auth_header, ); } - if let Some(order_by) = &this.order_by { - req.url_mut() - .query_pairs_mut() - .append_pair("orderBy", order_by); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -376,12 +406,45 @@ pub mod pipelines { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CreatePipelineParameters, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -391,9 +454,7 @@ pub mod pipelines { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -405,26 +466,24 @@ pub mod pipelines { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -474,19 +533,58 @@ pub mod pipelines { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) pipeline_id: i32, pub(crate) pipeline_version: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The pipeline version"] pub fn pipeline_version(mut self, pipeline_version: i32) -> Self { self.pipeline_version = Some(pipeline_version); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}", + self.client.endpoint(), + self.organization, + self.project, + self.pipeline_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -495,9 +593,7 @@ pub mod pipelines { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -509,31 +605,24 @@ pub mod pipelines { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}", - self.client.endpoint(), - self.organization, - self.project, - self.pipeline_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -616,20 +705,60 @@ pub mod preview { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::RunPipelineParameters, pub(crate) project: String, pub(crate) pipeline_id: i32, pub(crate) pipeline_version: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The pipeline version."] pub fn pipeline_version(mut self, pipeline_version: i32) -> Self { self.pipeline_version = Some(pipeline_version); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/preview", + self.client.endpoint(), + self.organization, + self.project, + self.pipeline_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -638,9 +767,7 @@ pub mod preview { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -652,32 +779,24 @@ pub mod preview { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/preview", - self.client.endpoint(), - self.organization, - self.project, - self.pipeline_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -801,12 +920,45 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) pipeline_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/runs", + self.client.endpoint(), + self.organization, + self.project, + self.pipeline_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -816,9 +968,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -830,26 +980,24 @@ pub mod runs { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/runs", - self.client.endpoint(), - self.organization, - self.project, - self.pipeline_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -897,20 +1045,60 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::RunPipelineParameters, pub(crate) project: String, pub(crate) pipeline_id: i32, pub(crate) pipeline_version: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The pipeline version."] pub fn pipeline_version(mut self, pipeline_version: i32) -> Self { self.pipeline_version = Some(pipeline_version); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/runs", + self.client.endpoint(), + self.organization, + self.project, + self.pipeline_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -919,9 +1107,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -933,32 +1119,24 @@ pub mod runs { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/runs", - self.client.endpoint(), - self.organization, - self.project, - self.pipeline_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1006,13 +1184,47 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) pipeline_id: i32, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/runs/{}", + self.client.endpoint(), + self.organization, + self.project, + self.pipeline_id, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1022,9 +1234,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1036,27 +1246,24 @@ pub mod runs { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/runs/{}", - self.client.endpoint(), - self.organization, - self.project, - self.pipeline_id, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1142,8 +1349,12 @@ pub mod artifacts { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) pipeline_id: i32, @@ -1151,12 +1362,52 @@ pub mod artifacts { pub(crate) artifact_name: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Expand options. Default is None."] pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let artifact_name = &this.artifact_name; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactName", artifact_name); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/runs/{}/artifacts", + self.client.endpoint(), + self.organization, + self.project, + self.pipeline_id, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1165,9 +1416,7 @@ pub mod artifacts { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1179,36 +1428,24 @@ pub mod artifacts { auth_header, ); } - let artifact_name = &this.artifact_name; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactName", artifact_name); - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/runs/{}/artifacts", - self.client.endpoint(), - self.organization, - self.project, - self.pipeline_id, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1317,20 +1554,60 @@ pub mod logs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) pipeline_id: i32, pub(crate) run_id: i32, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Expand options. Default is None."] pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/runs/{}/logs", + self.client.endpoint(), + self.organization, + self.project, + self.pipeline_id, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1339,9 +1616,7 @@ pub mod logs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1353,32 +1628,24 @@ pub mod logs { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/runs/{}/logs", - self.client.endpoint(), - self.organization, - self.project, - self.pipeline_id, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1426,8 +1693,12 @@ pub mod logs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) pipeline_id: i32, @@ -1435,12 +1706,49 @@ pub mod logs { pub(crate) log_id: i32, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Expand options. Default is None."] pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/pipelines/{}/runs/{}/logs/{}", + self.client.endpoint(), + self.organization, + self.project, + self.pipeline_id, + self.run_id, + self.log_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1449,9 +1757,7 @@ pub mod logs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1463,33 +1769,24 @@ pub mod logs { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/pipelines/{}/runs/{}/logs/{}", - self.client.endpoint(), - self.organization, - self.project, - self.pipeline_id, - self.run_id, - self.log_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1506,3 +1803,315 @@ pub mod logs { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn artifacts_client(&self) -> artifacts::Client { + artifacts::Client(self.clone()) + } + pub fn logs_client(&self) -> logs::Client { + logs::Client(self.clone()) + } + pub fn pipelines_client(&self) -> pipelines::Client { + pipelines::Client(self.clone()) + } + pub fn preview_client(&self) -> preview::Client { + preview::Client(self.clone()) + } + pub fn runs_client(&self) -> runs::Client { + runs::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod pipelines { + use super::super::models; + use super::super::pipelines::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of pipelines."] + #[doc = ""] + #[doc = "See [`list`](super::super::pipelines::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + order_by: None, + top: None, + continuation_token: None, + } + } + #[doc = "Create a pipeline."] + #[doc = ""] + #[doc = "See [`create`](super::super::pipelines::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Gets a pipeline, optionally at the specified version"] + #[doc = ""] + #[doc = "See [`get`](super::super::pipelines::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + pipeline_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + pipeline_id, + pipeline_version: None, + } + } + } + } + pub mod preview { + use super::super::models; + use super::super::preview::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Queues a dry run of the pipeline and returns an object containing the final yaml."] + #[doc = ""] + #[doc = "See [`preview`](super::super::preview::Client::preview) for details of the arguments."] + pub fn preview( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + pipeline_id: i32, + ) -> preview::RequestBuilder { + preview::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + pipeline_id, + pipeline_version: None, + } + } + } + } + pub mod runs { + use super::super::models; + use super::super::runs::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets top 10000 runs for a particular pipeline."] + #[doc = ""] + #[doc = "See [`list`](super::super::runs::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + pipeline_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + pipeline_id, + } + } + #[doc = "Runs a pipeline."] + #[doc = ""] + #[doc = "See [`run_pipeline`](super::super::runs::Client::run_pipeline) for details of the arguments."] + pub fn run_pipeline( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + pipeline_id: i32, + ) -> run_pipeline::RequestBuilder { + run_pipeline::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + pipeline_id, + pipeline_version: None, + } + } + #[doc = "Gets a run for a particular pipeline."] + #[doc = ""] + #[doc = "See [`get`](super::super::runs::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + pipeline_id: i32, + run_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + pipeline_id, + run_id, + } + } + } + } + pub mod artifacts { + use super::super::artifacts::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a specific artifact from a pipeline run"] + #[doc = ""] + #[doc = "See [`get`](super::super::artifacts::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + pipeline_id: i32, + run_id: i32, + artifact_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + pipeline_id, + run_id, + artifact_name: artifact_name.into(), + expand: None, + } + } + } + } + pub mod logs { + use super::super::logs::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of logs from a pipeline run."] + #[doc = ""] + #[doc = "See [`list`](super::super::logs::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + pipeline_id: i32, + run_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + pipeline_id, + run_id, + expand: None, + } + } + #[doc = "Get a specific log from a pipeline run"] + #[doc = ""] + #[doc = "See [`get`](super::super::logs::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + pipeline_id: i32, + run_id: i32, + log_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + pipeline_id, + run_id, + log_id, + expand: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/policy/mod.rs b/azure_devops_rust_api/src/policy/mod.rs index 78237b00..6cc683cd 100644 --- a/azure_devops_rust_api/src/policy/mod.rs +++ b/azure_devops_rust_api/src/policy/mod.rs @@ -288,8 +288,12 @@ pub mod configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) scope: Option, @@ -297,7 +301,7 @@ pub mod configurations { pub(crate) continuation_token: Option, pub(crate) policy_type: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "\\[Provided for legacy reasons\\] The scope on which a subset of policies is defined."] pub fn scope(mut self, scope: impl Into) -> Self { self.scope = Some(scope.into()); @@ -318,6 +322,53 @@ pub mod configurations { self.policy_type = Some(policy_type.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(scope) = &this.scope { + req.url_mut().query_pairs_mut().append_pair("scope", scope); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(policy_type) = &this.policy_type { + req.url_mut() + .query_pairs_mut() + .append_pair("policyType", policy_type); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -326,9 +377,7 @@ pub mod configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -340,43 +389,24 @@ pub mod configurations { auth_header, ); } - if let Some(scope) = &this.scope { - req.url_mut().query_pairs_mut().append_pair("scope", scope); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(policy_type) = &this.policy_type { - req.url_mut() - .query_pairs_mut() - .append_pair("policyType", policy_type); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -427,12 +457,45 @@ pub mod configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PolicyConfiguration, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -442,9 +505,7 @@ pub mod configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -456,26 +517,24 @@ pub mod configurations { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -525,12 +584,45 @@ pub mod configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) configuration_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations/{}", + self.client.endpoint(), + self.organization, + self.project, + self.configuration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -540,9 +632,7 @@ pub mod configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -554,26 +644,24 @@ pub mod configurations { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations/{}", - self.client.endpoint(), - self.organization, - self.project, - self.configuration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -623,13 +711,47 @@ pub mod configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PolicyConfiguration, pub(crate) project: String, pub(crate) configuration_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations/{}", + self.client.endpoint(), + self.organization, + self.project, + self.configuration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -639,9 +761,7 @@ pub mod configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -653,27 +773,24 @@ pub mod configurations { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations/{}", - self.client.endpoint(), - self.organization, - self.project, - self.configuration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -718,12 +835,45 @@ pub mod configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) configuration_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations/{}", + self.client.endpoint(), + self.organization, + self.project, + self.configuration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -733,9 +883,7 @@ pub mod configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -747,26 +895,24 @@ pub mod configurations { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations/{}", - self.client.endpoint(), - self.organization, - self.project, - self.configuration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -875,15 +1021,19 @@ pub mod revisions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) configuration_id: i32, pub(crate) top: Option, pub(crate) skip: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The number of revisions to retrieve."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -894,6 +1044,46 @@ pub mod revisions { self.skip = Some(skip); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations/{}/revisions", + self.client.endpoint(), + self.organization, + self.project, + self.configuration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -902,9 +1092,7 @@ pub mod revisions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -916,36 +1104,24 @@ pub mod revisions { auth_header, ); } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations/{}/revisions", - self.client.endpoint(), - self.organization, - self.project, - self.configuration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -996,13 +1172,47 @@ pub mod revisions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) configuration_id: i32, pub(crate) revision_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/policy/configurations/{}/revisions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.configuration_id, + self.revision_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1012,9 +1222,7 @@ pub mod revisions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1026,27 +1234,24 @@ pub mod revisions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/policy/configurations/{}/revisions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.configuration_id, - self.revision_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1169,8 +1374,12 @@ pub mod evaluations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) artifact_id: String, @@ -1178,7 +1387,7 @@ pub mod evaluations { pub(crate) top: Option, pub(crate) skip: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Some policies might determine that they do not apply to a specific pull request. Setting this parameter to true will return evaluation records even for policies which don't apply to this pull request."] pub fn include_not_applicable(mut self, include_not_applicable: bool) -> Self { self.include_not_applicable = Some(include_not_applicable); @@ -1194,6 +1403,54 @@ pub mod evaluations { self.skip = Some(skip); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let artifact_id = &this.artifact_id; + req.url_mut() + .query_pairs_mut() + .append_pair("artifactId", artifact_id); + if let Some(include_not_applicable) = &this.include_not_applicable { + req.url_mut() + .query_pairs_mut() + .append_pair("includeNotApplicable", &include_not_applicable.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/policy/evaluations", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1202,9 +1459,7 @@ pub mod evaluations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1216,45 +1471,24 @@ pub mod evaluations { auth_header, ); } - let artifact_id = &this.artifact_id; - req.url_mut() - .query_pairs_mut() - .append_pair("artifactId", artifact_id); - if let Some(include_not_applicable) = &this.include_not_applicable { - req.url_mut().query_pairs_mut().append_pair( - "includeNotApplicable", - &include_not_applicable.to_string(), - ); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/policy/evaluations", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1308,12 +1542,45 @@ pub mod evaluations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) evaluation_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/policy/evaluations/{}", + self.client.endpoint(), + self.organization, + self.project, + self.evaluation_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1323,9 +1590,7 @@ pub mod evaluations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1337,26 +1602,24 @@ pub mod evaluations { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/policy/evaluations/{}", - self.client.endpoint(), - self.organization, - self.project, - self.evaluation_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1410,12 +1673,45 @@ pub mod evaluations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) evaluation_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/policy/evaluations/{}", + self.client.endpoint(), + self.organization, + self.project, + self.evaluation_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1425,9 +1721,7 @@ pub mod evaluations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1439,26 +1733,24 @@ pub mod evaluations { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/policy/evaluations/{}", - self.client.endpoint(), - self.organization, - self.project, - self.evaluation_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1554,11 +1846,43 @@ pub mod types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/policy/types", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1568,9 +1892,7 @@ pub mod types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1582,25 +1904,24 @@ pub mod types { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/policy/types", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1650,12 +1971,45 @@ pub mod types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) type_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/policy/types/{}", + self.client.endpoint(), + self.organization, + self.project, + self.type_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1665,9 +2019,7 @@ pub mod types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1679,26 +2031,24 @@ pub mod types { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/policy/types/{}", - self.client.endpoint(), - self.organization, - self.project, - self.type_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1715,3 +2065,323 @@ pub mod types { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn configurations_client(&self) -> configurations::Client { + configurations::Client(self.clone()) + } + pub fn evaluations_client(&self) -> evaluations::Client { + evaluations::Client(self.clone()) + } + pub fn revisions_client(&self) -> revisions::Client { + revisions::Client(self.clone()) + } + pub fn types_client(&self) -> types::Client { + types::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod configurations { + use super::super::configurations::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of policy configurations in a project.\n\nThe 'scope' parameter for this API should not be used, except for legacy compatability reasons. It returns specifically\nscoped policies and does not support heirarchical nesting. Instead, use the /_apis/git/policy/configurations API, which provides\nfirst class scope filtering support.\n\nThe optional `policyType` parameter can be used to filter the set of policies returned from this method."] + #[doc = ""] + #[doc = "See [`list`](super::super::configurations::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + scope: None, + top: None, + continuation_token: None, + policy_type: None, + } + } + #[doc = "Create a policy configuration of a given policy type."] + #[doc = ""] + #[doc = "See [`create`](super::super::configurations::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get a policy configuration by its ID."] + #[doc = ""] + #[doc = "See [`get`](super::super::configurations::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + configuration_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + configuration_id, + } + } + #[doc = "Update a policy configuration by its ID."] + #[doc = ""] + #[doc = "See [`update`](super::super::configurations::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + configuration_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + configuration_id, + } + } + #[doc = "Delete a policy configuration by its ID."] + #[doc = ""] + #[doc = "See [`delete`](super::super::configurations::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + configuration_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + configuration_id, + } + } + } + } + pub mod revisions { + use super::super::models; + use super::super::revisions::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve all revisions for a given policy."] + #[doc = ""] + #[doc = "See [`list`](super::super::revisions::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + configuration_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + configuration_id, + top: None, + skip: None, + } + } + #[doc = "Retrieve a specific revision of a given policy by ID."] + #[doc = ""] + #[doc = "See [`get`](super::super::revisions::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + configuration_id: i32, + revision_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + configuration_id, + revision_id, + } + } + } + } + pub mod evaluations { + use super::super::evaluations::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieves a list of all the policy evaluation statuses for a specific pull request.\n\nEvaluations are retrieved using an artifact ID which uniquely identifies the pull request.\nTo generate an artifact ID for a pull request, use this template:\n```\nvstfs:///CodeReview/CodeReviewId/{projectId}/{pullRequestId}\n```"] + #[doc = ""] + #[doc = "See [`list`](super::super::evaluations::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + artifact_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + artifact_id: artifact_id.into(), + include_not_applicable: None, + top: None, + skip: None, + } + } + #[doc = "Gets the present evaluation state of a policy.\n\nEach policy which applies to a pull request will have an evaluation state which is specific to that policy running\nin the context of that pull request. Each evaluation is uniquely identified via a Guid. You can find all the policy\nevaluations for a specific pull request using the List operation of this controller."] + #[doc = ""] + #[doc = "See [`get`](super::super::evaluations::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + evaluation_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + evaluation_id: evaluation_id.into(), + } + } + #[doc = "Requeue the policy evaluation.\n\nSome policies define a \"requeue\" action which performs some policy-specific operation.\nYou can trigger this operation by updating an existing policy evaluation and setting the\nPolicyEvaluationRecord.Status field to Queued.\nAlthough any policy evaluation can be requeued, at present only build policies perform any action\nin response. Requeueing a build policy will queue a new build to run (cancelling any existing build which\nis running)."] + #[doc = ""] + #[doc = "See [`requeue_policy_evaluation`](super::super::evaluations::Client::requeue_policy_evaluation) for details of the arguments."] + pub fn requeue_policy_evaluation( + &self, + organization: impl Into, + project: impl Into, + evaluation_id: impl Into, + ) -> requeue_policy_evaluation::RequestBuilder { + requeue_policy_evaluation::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + evaluation_id: evaluation_id.into(), + } + } + } + } + pub mod types { + use super::super::models; + use super::super::types::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve all available policy types."] + #[doc = ""] + #[doc = "See [`list`](super::super::types::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Retrieve a specific policy type by ID."] + #[doc = ""] + #[doc = "See [`get`](super::super::types::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + type_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + type_id: type_id.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/processadmin/mod.rs b/azure_devops_rust_api/src/processadmin/mod.rs index 9464ae39..6f571bb7 100644 --- a/azure_devops_rust_api/src/processadmin/mod.rs +++ b/azure_devops_rust_api/src/processadmin/mod.rs @@ -215,12 +215,49 @@ pub mod behaviors { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) behavior_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processadmin/{}/behaviors?behaviorRefName={}", + self.client.endpoint(), + self.organization, + self.process_id, + self.behavior_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -230,9 +267,7 @@ pub mod behaviors { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -244,30 +279,24 @@ pub mod behaviors { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processadmin/{}/behaviors?behaviorRefName={}", - self.client.endpoint(), - self.organization, - self.process_id, - self.behavior_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -317,11 +346,43 @@ pub mod behaviors { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processadmin/{}/behaviors", + self.client.endpoint(), + self.organization, + self.process_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -331,9 +392,7 @@ pub mod behaviors { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -345,25 +404,24 @@ pub mod behaviors { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processadmin/{}/behaviors", - self.client.endpoint(), - self.organization, - self.process_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -471,11 +529,43 @@ pub mod processes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processadmin/processes/export/{}", + self.client.endpoint(), + self.organization, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -485,9 +575,7 @@ pub mod processes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -499,25 +587,24 @@ pub mod processes { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processadmin/processes/export/{}", - self.client.endpoint(), - self.organization, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -567,14 +654,18 @@ pub mod processes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: String, pub(crate) ignore_warnings: Option, pub(crate) replace_existing_template: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Ignores validation warnings. Default value is false."] pub fn ignore_warnings(mut self, ignore_warnings: bool) -> Self { self.ignore_warnings = Some(ignore_warnings); @@ -585,6 +676,46 @@ pub mod processes { self.replace_existing_template = Some(replace_existing_template); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/octet-stream"); + let req_body = azure_core::json::to_json(&this.body)?; + if let Some(ignore_warnings) = &this.ignore_warnings { + req.url_mut() + .query_pairs_mut() + .append_pair("ignoreWarnings", &ignore_warnings.to_string()); + } + if let Some(replace_existing_template) = &this.replace_existing_template { + req.url_mut().query_pairs_mut().append_pair( + "replaceExistingTemplate", + &replace_existing_template.to_string(), + ); + } + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -593,9 +724,7 @@ pub mod processes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -607,36 +736,24 @@ pub mod processes { auth_header, ); } - req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::json::to_json(&this.body)?; - if let Some(ignore_warnings) = &this.ignore_warnings { - req.url_mut() - .query_pairs_mut() - .append_pair("ignoreWarnings", &ignore_warnings.to_string()); - } - if let Some(replace_existing_template) = &this.replace_existing_template { - req.url_mut().query_pairs_mut().append_pair( - "replaceExistingTemplate", - &replace_existing_template.to_string(), - ); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -686,11 +803,43 @@ pub mod processes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processadmin/processes/status/{}", + self.client.endpoint(), + self.organization, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -700,9 +849,7 @@ pub mod processes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -714,25 +861,24 @@ pub mod processes { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processadmin/processes/status/{}", - self.client.endpoint(), - self.organization, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -749,3 +895,176 @@ pub mod processes { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn behaviors_client(&self) -> behaviors::Client { + behaviors::Client(self.clone()) + } + pub fn processes_client(&self) -> processes::Client { + processes::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod behaviors { + use super::super::behaviors::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a behavior for the process."] + #[doc = ""] + #[doc = "See [`get`](super::super::behaviors::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + process_id: impl Into, + behavior_ref_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + behavior_ref_name: behavior_ref_name.into(), + } + } + #[doc = "Returns a list of behaviors for the process."] + #[doc = ""] + #[doc = "See [`list`](super::super::behaviors::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + process_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + } + } + } + } + pub mod processes { + use super::super::models; + use super::super::processes::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns requested process template."] + #[doc = ""] + #[doc = "See [`export_process_template`](super::super::processes::Client::export_process_template) for details of the arguments."] + pub fn export_process_template( + &self, + organization: impl Into, + id: impl Into, + ) -> export_process_template::RequestBuilder { + export_process_template::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id: id.into(), + } + } + #[doc = "Imports a process from zip file."] + #[doc = ""] + #[doc = "See [`import_process_template`](super::super::processes::Client::import_process_template) for details of the arguments."] + pub fn import_process_template( + &self, + organization: impl Into, + body: impl Into, + ) -> import_process_template::RequestBuilder { + import_process_template::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + ignore_warnings: None, + replace_existing_template: None, + } + } + #[doc = "Tells whether promote has completed for the specified promote job ID."] + #[doc = ""] + #[doc = "See [`import_process_template_status`](super::super::processes::Client::import_process_template_status) for details of the arguments."] + pub fn import_process_template_status( + &self, + organization: impl Into, + id: impl Into, + ) -> import_process_template_status::RequestBuilder { + import_process_template_status::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id: id.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/processes/mod.rs b/azure_devops_rust_api/src/processes/mod.rs index 17493d18..adf08d7d 100644 --- a/azure_devops_rust_api/src/processes/mod.rs +++ b/azure_devops_rust_api/src/processes/mod.rs @@ -371,8 +371,12 @@ pub mod groups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Group, pub(crate) process_id: String, @@ -383,6 +387,38 @@ pub mod groups { pub(crate) remove_from_page_id: String, pub(crate) remove_from_section_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + 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() + .append_pair("removeFromPageId", remove_from_page_id); + 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(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -392,9 +428,7 @@ pub mod groups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -406,29 +440,24 @@ pub mod groups { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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() - .append_pair("removeFromPageId", remove_from_page_id); - 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?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -478,8 +507,12 @@ pub mod groups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Group, pub(crate) process_id: String, @@ -487,6 +520,30 @@ pub mod groups { pub(crate) page_id: String, pub(crate) section_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -496,9 +553,7 @@ pub mod groups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -510,21 +565,24 @@ pub mod groups { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -574,8 +632,12 @@ pub mod groups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Group, pub(crate) process_id: String, @@ -585,6 +647,34 @@ pub mod groups { pub(crate) group_id: String, pub(crate) remove_from_section_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -594,9 +684,7 @@ pub mod groups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -608,25 +696,24 @@ pub mod groups { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -676,8 +763,12 @@ pub mod groups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Group, pub(crate) process_id: String, @@ -686,6 +777,30 @@ pub mod groups { pub(crate) section_id: String, pub(crate) group_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -695,9 +810,7 @@ pub mod groups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -709,21 +822,24 @@ pub mod groups { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -768,8 +884,12 @@ pub mod groups { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, @@ -777,6 +897,29 @@ pub mod groups { pub(crate) section_id: String, pub(crate) group_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -786,9 +929,7 @@ pub mod groups { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -800,20 +941,24 @@ pub mod groups { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -951,16 +1096,53 @@ pub mod processes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -969,9 +1151,7 @@ pub mod processes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -983,29 +1163,24 @@ pub mod processes { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1055,11 +1230,43 @@ pub mod processes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CreateProcessModel, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1069,9 +1276,7 @@ pub mod processes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1083,25 +1288,24 @@ pub mod processes { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1151,17 +1355,55 @@ pub mod processes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_type_id: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}", + self.client.endpoint(), + self.organization, + self.process_type_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1170,9 +1412,7 @@ pub mod processes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1184,30 +1424,24 @@ pub mod processes { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}", - self.client.endpoint(), - self.organization, - self.process_type_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1257,12 +1491,45 @@ pub mod processes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UpdateProcessModel, pub(crate) process_type_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}", + self.client.endpoint(), + self.organization, + self.process_type_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1272,9 +1539,7 @@ pub mod processes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1286,26 +1551,24 @@ pub mod processes { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}", - self.client.endpoint(), - self.organization, - self.process_type_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1350,11 +1613,43 @@ pub mod processes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_type_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}", + self.client.endpoint(), + self.organization, + self.process_type_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1364,9 +1659,7 @@ pub mod processes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1378,25 +1671,24 @@ pub mod processes { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}", - self.client.endpoint(), - self.organization, - self.process_type_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1554,17 +1846,55 @@ pub mod behaviors { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/behaviors", + self.client.endpoint(), + self.organization, + self.process_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1573,9 +1903,7 @@ pub mod behaviors { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1587,30 +1915,24 @@ pub mod behaviors { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/behaviors", - self.client.endpoint(), - self.organization, - self.process_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1660,12 +1982,45 @@ pub mod behaviors { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ProcessBehaviorCreateRequest, pub(crate) process_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/behaviors", + self.client.endpoint(), + self.organization, + self.process_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1675,9 +2030,7 @@ pub mod behaviors { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1689,26 +2042,24 @@ pub mod behaviors { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/behaviors", - self.client.endpoint(), - self.organization, - self.process_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1758,18 +2109,57 @@ pub mod behaviors { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) behavior_ref_name: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/behaviors/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.behavior_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1778,9 +2168,7 @@ pub mod behaviors { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1792,31 +2180,24 @@ pub mod behaviors { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/behaviors/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.behavior_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1866,13 +2247,47 @@ pub mod behaviors { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ProcessBehaviorUpdateRequest, pub(crate) process_id: String, pub(crate) behavior_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/behaviors/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.behavior_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1882,9 +2297,7 @@ pub mod behaviors { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1896,27 +2309,24 @@ pub mod behaviors { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/behaviors/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.behavior_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1961,12 +2371,45 @@ pub mod behaviors { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) behavior_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/behaviors/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.behavior_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1976,9 +2419,7 @@ pub mod behaviors { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1990,26 +2431,24 @@ pub mod behaviors { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/behaviors/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.behavior_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2170,18 +2609,56 @@ pub mod work_item_types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Flag to determine what properties of work item type to return"] pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypes", + self.client.endpoint(), + self.organization, + self.process_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2190,9 +2667,7 @@ pub mod work_item_types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2204,30 +2679,24 @@ pub mod work_item_types { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypes", - self.client.endpoint(), - self.organization, - self.process_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2278,12 +2747,45 @@ pub mod work_item_types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CreateProcessWorkItemTypeRequest, pub(crate) process_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypes", + self.client.endpoint(), + self.organization, + self.process_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2293,9 +2795,7 @@ pub mod work_item_types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2307,26 +2807,24 @@ pub mod work_item_types { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypes", - self.client.endpoint(), - self.organization, - self.process_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2376,30 +2874,67 @@ pub mod work_item_types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Flag to determine what properties of work item type to return"] pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypes/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2411,31 +2946,24 @@ pub mod work_item_types { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypes/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2485,13 +3013,47 @@ pub mod work_item_types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UpdateProcessWorkItemTypeRequest, pub(crate) process_id: String, pub(crate) wit_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypes/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2501,9 +3063,7 @@ pub mod work_item_types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2515,27 +3075,24 @@ pub mod work_item_types { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypes/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2580,12 +3137,45 @@ pub mod work_item_types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypes/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2595,9 +3185,7 @@ pub mod work_item_types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2609,26 +3197,24 @@ pub mod work_item_types { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypes/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2803,12 +3389,45 @@ pub mod fields { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2818,9 +3437,7 @@ pub mod fields { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2832,26 +3449,24 @@ pub mod fields { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2905,13 +3520,47 @@ pub mod fields { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::AddProcessWorkItemTypeFieldRequest, pub(crate) process_id: String, pub(crate) wit_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2921,9 +3570,7 @@ pub mod fields { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2935,27 +3582,24 @@ pub mod fields { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3009,15 +3653,19 @@ pub mod fields { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) field_ref_name: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn expand( mut self, expand: impl Into, @@ -3025,6 +3673,42 @@ pub mod fields { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name, + self.field_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3033,9 +3717,7 @@ pub mod fields { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3047,32 +3729,24 @@ pub mod fields { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name, - self.field_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3126,14 +3800,49 @@ pub mod fields { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UpdateProcessWorkItemTypeFieldRequest, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) field_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name, + self.field_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3143,9 +3852,7 @@ pub mod fields { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3157,28 +3864,24 @@ pub mod fields { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name, - self.field_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3224,25 +3927,57 @@ pub mod fields { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) field_ref_name: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name, + self.field_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3254,27 +3989,24 @@ pub mod fields { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name, - self.field_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3356,12 +4088,45 @@ pub mod layout { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3371,9 +4136,7 @@ pub mod layout { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3385,26 +4148,24 @@ pub mod layout { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3571,14 +4332,49 @@ pub mod controls { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Control, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) group_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.process_id, + self.wit_ref_name, + self.group_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3588,9 +4384,7 @@ pub mod controls { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3602,28 +4396,24 @@ pub mod controls { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.process_id, - self.wit_ref_name, - self.group_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3673,8 +4463,12 @@ pub mod controls { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Control, pub(crate) process_id: String, @@ -3683,12 +4477,50 @@ pub mod controls { pub(crate) control_id: String, pub(crate) remove_from_group_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The group ID to remove the control from."] pub fn remove_from_group_id(mut self, remove_from_group_id: impl Into) -> Self { self.remove_from_group_id = Some(remove_from_group_id.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&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, + self.process_id, + self.wit_ref_name, + self.group_id, + self.control_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3697,9 +4529,7 @@ pub mod controls { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3711,34 +4541,24 @@ pub mod controls { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&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, - self.process_id, - self.wit_ref_name, - self.group_id, - self.control_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3788,8 +4608,12 @@ pub mod controls { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Control, pub(crate) process_id: String, @@ -3797,6 +4621,38 @@ pub mod controls { pub(crate) group_id: String, pub(crate) control_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.process_id, + self.wit_ref_name, + self.group_id, + self.control_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3806,9 +4662,7 @@ pub mod controls { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3820,29 +4674,24 @@ pub mod controls { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.process_id, - self.wit_ref_name, - self.group_id, - self.control_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3887,14 +4736,49 @@ pub mod controls { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) group_id: String, pub(crate) control_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.process_id, + self.wit_ref_name, + self.group_id, + self.control_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3904,9 +4788,7 @@ pub mod controls { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3918,28 +4800,24 @@ pub mod controls { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.process_id, - self.wit_ref_name, - self.group_id, - self.control_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4066,13 +4944,47 @@ pub mod pages { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Page, pub(crate) process_id: String, pub(crate) wit_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4082,9 +4994,7 @@ pub mod pages { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4096,27 +5006,24 @@ pub mod pages { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4164,13 +5071,47 @@ pub mod pages { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Page, pub(crate) process_id: String, pub(crate) wit_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4180,9 +5121,7 @@ pub mod pages { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4194,27 +5133,24 @@ pub mod pages { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4259,13 +5195,47 @@ pub mod pages { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) page_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name, + self.page_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4275,9 +5245,7 @@ pub mod pages { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4289,27 +5257,24 @@ pub mod pages { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name, - self.page_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4437,12 +5402,45 @@ pub mod system_controls { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4452,9 +5450,7 @@ pub mod system_controls { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4466,26 +5462,24 @@ pub mod system_controls { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4535,14 +5529,49 @@ pub mod system_controls { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Control, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) control_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name, + self.control_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4552,9 +5581,7 @@ pub mod system_controls { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4566,28 +5593,24 @@ pub mod system_controls { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name, - self.control_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4637,13 +5660,47 @@ pub mod system_controls { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) control_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name, + self.control_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4653,9 +5710,7 @@ pub mod system_controls { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4667,27 +5722,24 @@ pub mod system_controls { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name, - self.control_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4855,12 +5907,45 @@ pub mod rules { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4870,9 +5955,7 @@ pub mod rules { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4884,26 +5967,24 @@ pub mod rules { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4953,13 +6034,47 @@ pub mod rules { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CreateProcessRuleRequest, pub(crate) process_id: String, pub(crate) wit_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4969,9 +6084,7 @@ pub mod rules { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4983,27 +6096,24 @@ pub mod rules { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5053,41 +6163,29 @@ pub mod rules { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) rule_id: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -5106,6 +6204,47 @@ pub mod rules { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -5153,14 +6292,49 @@ pub mod rules { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UpdateProcessRuleRequest, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) rule_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name, + self.rule_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5170,9 +6344,7 @@ pub mod rules { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5184,28 +6356,24 @@ pub mod rules { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name, - self.rule_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5250,13 +6418,47 @@ pub mod rules { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) rule_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name, + self.rule_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5266,9 +6468,7 @@ pub mod rules { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5280,27 +6480,24 @@ pub mod rules { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name, - self.rule_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5498,12 +6695,45 @@ pub mod states { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5513,9 +6743,7 @@ pub mod states { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5527,26 +6755,24 @@ pub mod states { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5600,13 +6826,47 @@ pub mod states { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemStateInputModel, pub(crate) process_id: String, pub(crate) wit_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5616,9 +6876,7 @@ pub mod states { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5630,27 +6888,24 @@ pub mod states { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5704,13 +6959,47 @@ pub mod states { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) state_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name, + self.state_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5720,9 +7009,7 @@ pub mod states { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5734,27 +7021,24 @@ pub mod states { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name, - self.state_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5808,14 +7092,49 @@ pub mod states { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::HideStateModel, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) state_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name, + self.state_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5825,9 +7144,7 @@ pub mod states { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5839,28 +7156,24 @@ pub mod states { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name, - self.state_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5914,43 +7227,31 @@ pub mod states { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemStateInputModel, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) state_id: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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::http::headers::AUTHORIZATION, - auth_header, - ); - } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -5969,6 +7270,47 @@ pub mod states { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = @@ -6012,13 +7354,47 @@ pub mod states { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name: String, pub(crate) state_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name, + self.state_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6028,9 +7404,7 @@ pub mod states { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6042,27 +7416,24 @@ pub mod states { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name, - self.state_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6233,12 +7604,45 @@ pub mod work_item_types_behaviors { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name_for_behaviors: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name_for_behaviors + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6248,9 +7652,7 @@ pub mod work_item_types_behaviors { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6262,26 +7664,24 @@ pub mod work_item_types_behaviors { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name_for_behaviors - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6332,13 +7732,47 @@ pub mod work_item_types_behaviors { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemTypeBehavior, pub(crate) process_id: String, pub(crate) wit_ref_name_for_behaviors: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name_for_behaviors + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6348,9 +7782,7 @@ pub mod work_item_types_behaviors { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6362,27 +7794,24 @@ pub mod work_item_types_behaviors { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name_for_behaviors - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6432,13 +7861,47 @@ pub mod work_item_types_behaviors { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemTypeBehavior, pub(crate) process_id: String, pub(crate) wit_ref_name_for_behaviors: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name_for_behaviors + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6448,9 +7911,7 @@ pub mod work_item_types_behaviors { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6462,27 +7923,24 @@ pub mod work_item_types_behaviors { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name_for_behaviors - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6532,13 +7990,47 @@ pub mod work_item_types_behaviors { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name_for_behaviors: String, pub(crate) behavior_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name_for_behaviors, + self.behavior_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6548,9 +8040,7 @@ pub mod work_item_types_behaviors { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6562,27 +8052,24 @@ pub mod work_item_types_behaviors { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name_for_behaviors, - self.behavior_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6627,13 +8114,47 @@ pub mod work_item_types_behaviors { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) process_id: String, pub(crate) wit_ref_name_for_behaviors: String, pub(crate) behavior_ref_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors/{}", + self.client.endpoint(), + self.organization, + self.process_id, + self.wit_ref_name_for_behaviors, + self.behavior_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6643,9 +8164,7 @@ pub mod work_item_types_behaviors { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6657,27 +8176,24 @@ pub mod work_item_types_behaviors { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors/{}", - self.client.endpoint(), - self.organization, - self.process_id, - self.wit_ref_name_for_behaviors, - self.behavior_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6816,10 +8332,41 @@ pub mod lists { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6829,9 +8376,7 @@ pub mod lists { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6843,24 +8388,24 @@ pub mod lists { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6910,11 +8455,43 @@ pub mod lists { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PickList, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6924,9 +8501,7 @@ pub mod lists { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6938,25 +8513,24 @@ pub mod lists { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7006,11 +8580,43 @@ pub mod lists { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) list_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/lists/{}", + self.client.endpoint(), + self.organization, + self.list_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7020,9 +8626,7 @@ pub mod lists { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7034,25 +8638,24 @@ pub mod lists { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/lists/{}", - self.client.endpoint(), - self.organization, - self.list_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7102,12 +8705,45 @@ pub mod lists { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PickList, pub(crate) list_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/lists/{}", + self.client.endpoint(), + self.organization, + self.list_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7117,9 +8753,7 @@ pub mod lists { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7131,26 +8765,24 @@ pub mod lists { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/lists/{}", - self.client.endpoint(), - self.organization, - self.list_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7195,11 +8827,43 @@ pub mod lists { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) list_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/work/processes/lists/{}", + self.client.endpoint(), + self.organization, + self.list_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7209,9 +8873,7 @@ pub mod lists { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7223,25 +8885,24 @@ pub mod lists { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/work/processes/lists/{}", - self.client.endpoint(), - self.organization, - self.list_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7261,3 +8922,1228 @@ pub mod lists { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn behaviors_client(&self) -> behaviors::Client { + behaviors::Client(self.clone()) + } + pub fn controls_client(&self) -> controls::Client { + controls::Client(self.clone()) + } + pub fn fields_client(&self) -> fields::Client { + fields::Client(self.clone()) + } + pub fn groups_client(&self) -> groups::Client { + groups::Client(self.clone()) + } + pub fn layout_client(&self) -> layout::Client { + layout::Client(self.clone()) + } + pub fn lists_client(&self) -> lists::Client { + lists::Client(self.clone()) + } + pub fn pages_client(&self) -> pages::Client { + pages::Client(self.clone()) + } + pub fn processes_client(&self) -> processes::Client { + processes::Client(self.clone()) + } + pub fn rules_client(&self) -> rules::Client { + rules::Client(self.clone()) + } + pub fn states_client(&self) -> states::Client { + states::Client(self.clone()) + } + pub fn system_controls_client(&self) -> system_controls::Client { + system_controls::Client(self.clone()) + } + pub fn work_item_types_client(&self) -> work_item_types::Client { + work_item_types::Client(self.clone()) + } + pub fn work_item_types_behaviors_client(&self) -> work_item_types_behaviors::Client { + work_item_types_behaviors::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod groups { + use super::super::groups::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Moves a group to a different page and section."] + #[doc = ""] + #[doc = "See [`move_group_to_page`](super::super::groups::Client::move_group_to_page) for details of the arguments."] + pub fn move_group_to_page( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + page_id: impl Into, + section_id: impl Into, + group_id: impl Into, + remove_from_page_id: impl Into, + remove_from_section_id: impl Into, + ) -> move_group_to_page::RequestBuilder { + move_group_to_page::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + page_id: page_id.into(), + section_id: section_id.into(), + group_id: group_id.into(), + remove_from_page_id: remove_from_page_id.into(), + remove_from_section_id: remove_from_section_id.into(), + } + } + #[doc = "Adds a group to the work item form."] + #[doc = ""] + #[doc = "See [`add`](super::super::groups::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + page_id: impl Into, + section_id: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + page_id: page_id.into(), + section_id: section_id.into(), + } + } + #[doc = "Moves a group to a different section."] + #[doc = ""] + #[doc = "See [`move_group_to_section`](super::super::groups::Client::move_group_to_section) for details of the arguments."] + pub fn move_group_to_section( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + page_id: impl Into, + section_id: impl Into, + group_id: impl Into, + remove_from_section_id: impl Into, + ) -> move_group_to_section::RequestBuilder { + move_group_to_section::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + page_id: page_id.into(), + section_id: section_id.into(), + group_id: group_id.into(), + remove_from_section_id: remove_from_section_id.into(), + } + } + #[doc = "Updates a group in the work item form."] + #[doc = ""] + #[doc = "See [`update`](super::super::groups::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + page_id: impl Into, + section_id: impl Into, + group_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + page_id: page_id.into(), + section_id: section_id.into(), + group_id: group_id.into(), + } + } + #[doc = "Removes a group from the work item form."] + #[doc = ""] + #[doc = "See [`remove_group`](super::super::groups::Client::remove_group) for details of the arguments."] + pub fn remove_group( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + page_id: impl Into, + section_id: impl Into, + group_id: impl Into, + ) -> remove_group::RequestBuilder { + remove_group::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + page_id: page_id.into(), + section_id: section_id.into(), + group_id: group_id.into(), + } + } + } + } + pub mod processes { + use super::super::models; + use super::super::processes::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get list of all processes including system and inherited."] + #[doc = ""] + #[doc = "See [`list`](super::super::processes::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + expand: None, + } + } + #[doc = "Creates a process."] + #[doc = ""] + #[doc = "See [`create`](super::super::processes::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Get a single process of a specified ID."] + #[doc = ""] + #[doc = "See [`get`](super::super::processes::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + process_type_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_type_id: process_type_id.into(), + expand: None, + } + } + #[doc = "Edit a process of a specific ID."] + #[doc = ""] + #[doc = "See [`edit_process`](super::super::processes::Client::edit_process) for details of the arguments."] + pub fn edit_process( + &self, + organization: impl Into, + body: impl Into, + process_type_id: impl Into, + ) -> edit_process::RequestBuilder { + edit_process::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_type_id: process_type_id.into(), + } + } + #[doc = "Removes a process of a specific ID."] + #[doc = ""] + #[doc = "See [`delete`](super::super::processes::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + process_type_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_type_id: process_type_id.into(), + } + } + } + } + pub mod behaviors { + use super::super::behaviors::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a list of all behaviors in the process."] + #[doc = ""] + #[doc = "See [`list`](super::super::behaviors::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + process_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + expand: None, + } + } + #[doc = "Creates a single behavior in the given process."] + #[doc = ""] + #[doc = "See [`create`](super::super::behaviors::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + } + } + #[doc = "Returns a behavior of the process."] + #[doc = ""] + #[doc = "See [`get`](super::super::behaviors::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + process_id: impl Into, + behavior_ref_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + behavior_ref_name: behavior_ref_name.into(), + expand: None, + } + } + #[doc = "Replaces a behavior in the process."] + #[doc = ""] + #[doc = "See [`update`](super::super::behaviors::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + behavior_ref_name: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + behavior_ref_name: behavior_ref_name.into(), + } + } + #[doc = "Removes a behavior in the process."] + #[doc = ""] + #[doc = "See [`delete`](super::super::behaviors::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + process_id: impl Into, + behavior_ref_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + behavior_ref_name: behavior_ref_name.into(), + } + } + } + } + pub mod work_item_types { + use super::super::models; + use super::super::work_item_types::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a list of all work item types in a process."] + #[doc = ""] + #[doc = "See [`list`](super::super::work_item_types::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + process_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + expand: None, + } + } + #[doc = "Creates a work item type in the process."] + #[doc = ""] + #[doc = "See [`create`](super::super::work_item_types::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + } + } + #[doc = "Returns a single work item type in a process."] + #[doc = ""] + #[doc = "See [`get`](super::super::work_item_types::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + expand: None, + } + } + #[doc = "Updates a work item type of the process."] + #[doc = ""] + #[doc = "See [`update`](super::super::work_item_types::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + } + } + #[doc = "Removes a work item type in the process."] + #[doc = ""] + #[doc = "See [`delete`](super::super::work_item_types::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + } + } + } + } + pub mod fields { + use super::super::fields::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a list of all fields in a work item type."] + #[doc = ""] + #[doc = "See [`list`](super::super::fields::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + } + } + #[doc = "Adds a field to a work item type."] + #[doc = ""] + #[doc = "See [`add`](super::super::fields::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + } + } + #[doc = "Returns a field in a work item type."] + #[doc = ""] + #[doc = "See [`get`](super::super::fields::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + field_ref_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + field_ref_name: field_ref_name.into(), + expand: None, + } + } + #[doc = "Updates a field in a work item type."] + #[doc = ""] + #[doc = "See [`update`](super::super::fields::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + field_ref_name: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + field_ref_name: field_ref_name.into(), + } + } + #[doc = "Removes a field from a work item type. Does not permanently delete the field."] + #[doc = ""] + #[doc = "See [`remove_work_item_type_field`](super::super::fields::Client::remove_work_item_type_field) for details of the arguments."] + pub fn remove_work_item_type_field( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + field_ref_name: impl Into, + ) -> remove_work_item_type_field::RequestBuilder { + remove_work_item_type_field::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + field_ref_name: field_ref_name.into(), + } + } + } + } + pub mod layout { + use super::super::layout::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the form layout."] + #[doc = ""] + #[doc = "See [`get`](super::super::layout::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + } + } + } + } + pub mod controls { + use super::super::controls::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Creates a control in a group."] + #[doc = ""] + #[doc = "See [`create`](super::super::controls::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + group_id: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + group_id: group_id.into(), + } + } + #[doc = "Moves a control to a specified group."] + #[doc = ""] + #[doc = "See [`move_control_to_group`](super::super::controls::Client::move_control_to_group) for details of the arguments."] + pub fn move_control_to_group( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + group_id: impl Into, + control_id: impl Into, + ) -> move_control_to_group::RequestBuilder { + move_control_to_group::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + group_id: group_id.into(), + control_id: control_id.into(), + remove_from_group_id: None, + } + } + #[doc = "Updates a control on the work item form."] + #[doc = ""] + #[doc = "See [`update`](super::super::controls::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + group_id: impl Into, + control_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + group_id: group_id.into(), + control_id: control_id.into(), + } + } + #[doc = "Removes a control from the work item form."] + #[doc = ""] + #[doc = "See [`remove_control_from_group`](super::super::controls::Client::remove_control_from_group) for details of the arguments."] + pub fn remove_control_from_group( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + group_id: impl Into, + control_id: impl Into, + ) -> remove_control_from_group::RequestBuilder { + remove_control_from_group::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + group_id: group_id.into(), + control_id: control_id.into(), + } + } + } + } + pub mod pages { + use super::super::models; + use super::super::pages::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Adds a page to the work item form."] + #[doc = ""] + #[doc = "See [`add`](super::super::pages::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + } + } + #[doc = "Updates a page on the work item form"] + #[doc = ""] + #[doc = "See [`update`](super::super::pages::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + } + } + #[doc = "Removes a page from the work item form"] + #[doc = ""] + #[doc = "See [`remove_page`](super::super::pages::Client::remove_page) for details of the arguments."] + pub fn remove_page( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + page_id: impl Into, + ) -> remove_page::RequestBuilder { + remove_page::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + page_id: page_id.into(), + } + } + } + } + pub mod system_controls { + use super::super::models; + use super::super::system_controls::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets edited system controls for a work item type in a process. To get all system controls (base + edited) use layout API(s)"] + #[doc = ""] + #[doc = "See [`list`](super::super::system_controls::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + } + } + #[doc = "Updates/adds a system control on the work item form."] + #[doc = ""] + #[doc = "See [`update`](super::super::system_controls::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + control_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + control_id: control_id.into(), + } + } + #[doc = "Deletes a system control modification on the work item form."] + #[doc = ""] + #[doc = "See [`delete`](super::super::system_controls::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + control_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + control_id: control_id.into(), + } + } + } + } + pub mod rules { + use super::super::models; + use super::super::rules::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a list of all rules in the work item type of the process."] + #[doc = ""] + #[doc = "See [`list`](super::super::rules::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + } + } + #[doc = "Adds a rule to work item type in the process."] + #[doc = ""] + #[doc = "See [`add`](super::super::rules::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + } + } + #[doc = "Returns a single rule in the work item type of the process."] + #[doc = ""] + #[doc = "See [`get`](super::super::rules::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + rule_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + rule_id: rule_id.into(), + } + } + #[doc = "Updates a rule in the work item type of the process."] + #[doc = ""] + #[doc = "See [`update`](super::super::rules::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + rule_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + rule_id: rule_id.into(), + } + } + #[doc = "Removes a rule from the work item type in the process."] + #[doc = ""] + #[doc = "See [`delete`](super::super::rules::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + rule_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + rule_id: rule_id.into(), + } + } + } + } + pub mod states { + use super::super::models; + use super::super::states::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a list of all state definitions in a work item type of the process."] + #[doc = ""] + #[doc = "See [`list`](super::super::states::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + } + } + #[doc = "Creates a state definition in the work item type of the process."] + #[doc = ""] + #[doc = "See [`create`](super::super::states::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + } + } + #[doc = "Returns a single state definition in a work item type of the process."] + #[doc = ""] + #[doc = "See [`get`](super::super::states::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + state_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + state_id: state_id.into(), + } + } + #[doc = "Hides a state definition in the work item type of the process.Only states with customizationType:System can be hidden."] + #[doc = ""] + #[doc = "See [`hide_state_definition`](super::super::states::Client::hide_state_definition) for details of the arguments."] + pub fn hide_state_definition( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + state_id: impl Into, + ) -> hide_state_definition::RequestBuilder { + hide_state_definition::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + state_id: state_id.into(), + } + } + #[doc = "Updates a given state definition in the work item type of the process."] + #[doc = ""] + #[doc = "See [`update`](super::super::states::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + state_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + state_id: state_id.into(), + } + } + #[doc = "Removes a state definition in the work item type of the process."] + #[doc = ""] + #[doc = "See [`delete`](super::super::states::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name: impl Into, + state_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name: wit_ref_name.into(), + state_id: state_id.into(), + } + } + } + } + pub mod work_item_types_behaviors { + use super::super::models; + use super::super::work_item_types_behaviors::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a list of all behaviors for the work item type of the process."] + #[doc = ""] + #[doc = "See [`list`](super::super::work_item_types_behaviors::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name_for_behaviors: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name_for_behaviors: wit_ref_name_for_behaviors.into(), + } + } + #[doc = "Adds a behavior to the work item type of the process."] + #[doc = ""] + #[doc = "See [`add`](super::super::work_item_types_behaviors::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name_for_behaviors: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name_for_behaviors: wit_ref_name_for_behaviors.into(), + } + } + #[doc = "Updates a behavior for the work item type of the process."] + #[doc = ""] + #[doc = "See [`update`](super::super::work_item_types_behaviors::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + process_id: impl Into, + wit_ref_name_for_behaviors: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + process_id: process_id.into(), + wit_ref_name_for_behaviors: wit_ref_name_for_behaviors.into(), + } + } + #[doc = "Returns a behavior for the work item type of the process."] + #[doc = ""] + #[doc = "See [`get`](super::super::work_item_types_behaviors::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name_for_behaviors: impl Into, + behavior_ref_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name_for_behaviors: wit_ref_name_for_behaviors.into(), + behavior_ref_name: behavior_ref_name.into(), + } + } + #[doc = "Removes a behavior for the work item type of the process."] + #[doc = ""] + #[doc = "See [`remove_behavior_from_work_item_type`](super::super::work_item_types_behaviors::Client::remove_behavior_from_work_item_type) for details of the arguments."] + pub fn remove_behavior_from_work_item_type( + &self, + organization: impl Into, + process_id: impl Into, + wit_ref_name_for_behaviors: impl Into, + behavior_ref_name: impl Into, + ) -> remove_behavior_from_work_item_type::RequestBuilder { + remove_behavior_from_work_item_type::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + process_id: process_id.into(), + wit_ref_name_for_behaviors: wit_ref_name_for_behaviors.into(), + behavior_ref_name: behavior_ref_name.into(), + } + } + } + } + pub mod lists { + use super::super::lists::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns meta data of the picklist."] + #[doc = ""] + #[doc = "See [`list`](super::super::lists::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Creates a picklist."] + #[doc = ""] + #[doc = "See [`create`](super::super::lists::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Returns a picklist."] + #[doc = ""] + #[doc = "See [`get`](super::super::lists::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + list_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + list_id: list_id.into(), + } + } + #[doc = "Updates a list."] + #[doc = ""] + #[doc = "See [`update`](super::super::lists::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + list_id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + list_id: list_id.into(), + } + } + #[doc = "Removes a picklist."] + #[doc = ""] + #[doc = "See [`delete`](super::super::lists::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + list_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + list_id: list_id.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/profile/mod.rs b/azure_devops_rust_api/src/profile/mod.rs index c94c0c4e..27dc9c97 100644 --- a/azure_devops_rust_api/src/profile/mod.rs +++ b/azure_devops_rust_api/src/profile/mod.rs @@ -192,8 +192,12 @@ pub mod profiles { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) id: String, pub(crate) details: Option, pub(crate) with_attributes: Option, @@ -201,7 +205,7 @@ pub mod profiles { pub(crate) core_attributes: Option, pub(crate) force_refresh: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Return public profile information such as display name, email address, country, etc. If false, the withAttributes parameter is ignored."] pub fn details(mut self, details: bool) -> Self { self.details = Some(details); @@ -227,6 +231,59 @@ pub mod profiles { self.force_refresh = Some(force_refresh); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(details) = &this.details { + req.url_mut() + .query_pairs_mut() + .append_pair("details", &details.to_string()); + } + if let Some(with_attributes) = &this.with_attributes { + req.url_mut() + .query_pairs_mut() + .append_pair("withAttributes", &with_attributes.to_string()); + } + if let Some(partition) = &this.partition { + req.url_mut() + .query_pairs_mut() + .append_pair("partition", partition); + } + if let Some(core_attributes) = &this.core_attributes { + req.url_mut() + .query_pairs_mut() + .append_pair("coreAttributes", core_attributes); + } + if let Some(force_refresh) = &this.force_refresh { + req.url_mut() + .query_pairs_mut() + .append_pair("forceRefresh", &force_refresh.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -235,9 +292,7 @@ pub mod profiles { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -249,49 +304,24 @@ pub mod profiles { auth_header, ); } - if let Some(details) = &this.details { - req.url_mut() - .query_pairs_mut() - .append_pair("details", &details.to_string()); - } - if let Some(with_attributes) = &this.with_attributes { - req.url_mut() - .query_pairs_mut() - .append_pair("withAttributes", &with_attributes.to_string()); - } - if let Some(partition) = &this.partition { - req.url_mut() - .query_pairs_mut() - .append_pair("partition", partition); - } - if let Some(core_attributes) = &this.core_attributes { - req.url_mut() - .query_pairs_mut() - .append_pair("coreAttributes", core_attributes); - } - if let Some(force_refresh) = &this.force_refresh { - req.url_mut() - .query_pairs_mut() - .append_pair("forceRefresh", &force_refresh.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -308,3 +338,106 @@ pub mod profiles { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn profiles_client(&self) -> profiles::Client { + profiles::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod profiles { + use super::super::models; + use super::super::profiles::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a user profile."] + #[doc = ""] + #[doc = "See [`get`](super::super::profiles::Client::get) for details of the arguments."] + pub fn get(&self, id: impl Into) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + id: id.into(), + details: None, + with_attributes: None, + partition: None, + core_attributes: None, + force_refresh: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/release/mod.rs b/azure_devops_rust_api/src/release/mod.rs index bbaaa046..93f24337 100644 --- a/azure_devops_rust_api/src/release/mod.rs +++ b/azure_devops_rust_api/src/release/mod.rs @@ -440,8 +440,12 @@ pub mod releases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, @@ -450,7 +454,7 @@ pub mod releases { pub(crate) expand: Option, pub(crate) top_gate_records: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A filter which would allow fetching approval steps selectively based on whether it is automated, or manual. This would also decide whether we should fetch pre and post approval snapshots. Assumes All by default"] pub fn approval_filters( mut self, @@ -474,6 +478,56 @@ pub mod releases { self.top_gate_records = Some(top_gate_records); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(approval_filters) = &this.approval_filters { + req.url_mut() + .query_pairs_mut() + .append_pair("approvalFilters", &approval_filters.to_string()); + } + if let Some(property_filters) = &this.property_filters { + req.url_mut() + .query_pairs_mut() + .append_pair("propertyFilters", property_filters); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + if let Some(top_gate_records) = &this.top_gate_records { + req.url_mut() + .query_pairs_mut() + .append_pair("$topGateRecords", &top_gate_records.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases/{}?", + self.client.endpoint(), + self.organization, + self.project, + self.release_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -482,9 +536,7 @@ pub mod releases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -496,46 +548,24 @@ pub mod releases { auth_header, ); } - if let Some(approval_filters) = &this.approval_filters { - req.url_mut() - .query_pairs_mut() - .append_pair("approvalFilters", &approval_filters.to_string()); - } - if let Some(property_filters) = &this.property_filters { - req.url_mut() - .query_pairs_mut() - .append_pair("propertyFilters", property_filters); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - if let Some(top_gate_records) = &this.top_gate_records { - req.url_mut() - .query_pairs_mut() - .append_pair("$topGateRecords", &top_gate_records.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases/{}?", - self.client.endpoint(), - self.organization, - self.project, - self.release_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -585,8 +615,12 @@ pub mod releases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: Option, @@ -611,7 +645,7 @@ pub mod releases { pub(crate) release_id_filter: Option, pub(crate) path: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Releases from this release definition Id."] pub fn definition_id(mut self, definition_id: i32) -> Self { self.definition_id = Some(definition_id); @@ -727,6 +761,142 @@ pub mod releases { self.path = Some(path.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(definition_id) = &this.definition_id { + req.url_mut() + .query_pairs_mut() + .append_pair("definitionId", &definition_id.to_string()); + } + if let Some(definition_environment_id) = &this.definition_environment_id { + req.url_mut().query_pairs_mut().append_pair( + "definitionEnvironmentId", + &definition_environment_id.to_string(), + ); + } + if let Some(search_text) = &this.search_text { + req.url_mut() + .query_pairs_mut() + .append_pair("searchText", search_text); + } + if let Some(created_by) = &this.created_by { + req.url_mut() + .query_pairs_mut() + .append_pair("createdBy", created_by); + } + if let Some(status_filter) = &this.status_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("statusFilter", &status_filter.to_string()); + } + if let Some(environment_status_filter) = &this.environment_status_filter { + req.url_mut().query_pairs_mut().append_pair( + "environmentStatusFilter", + &environment_status_filter.to_string(), + ); + } + 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", &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", &formatted_date_time); + } + if let Some(query_order) = &this.query_order { + req.url_mut() + .query_pairs_mut() + .append_pair("queryOrder", &query_order.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", &continuation_token.to_string()); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + if let Some(artifact_type_id) = &this.artifact_type_id { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactTypeId", artifact_type_id); + } + if let Some(source_id) = &this.source_id { + req.url_mut() + .query_pairs_mut() + .append_pair("sourceId", source_id); + } + if let Some(artifact_version_id) = &this.artifact_version_id { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactVersionId", artifact_version_id); + } + if let Some(source_branch_filter) = &this.source_branch_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("sourceBranchFilter", source_branch_filter); + } + if let Some(is_deleted) = &this.is_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("isDeleted", &is_deleted.to_string()); + } + if let Some(tag_filter) = &this.tag_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("tagFilter", tag_filter); + } + if let Some(property_filters) = &this.property_filters { + req.url_mut() + .query_pairs_mut() + .append_pair("propertyFilters", property_filters); + } + if let Some(release_id_filter) = &this.release_id_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseIdFilter", release_id_filter); + } + if let Some(path) = &this.path { + req.url_mut().query_pairs_mut().append_pair("path", path); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -735,9 +905,7 @@ pub mod releases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -749,134 +917,24 @@ pub mod releases { auth_header, ); } - if let Some(definition_id) = &this.definition_id { - req.url_mut() - .query_pairs_mut() - .append_pair("definitionId", &definition_id.to_string()); - } - if let Some(definition_environment_id) = &this.definition_environment_id { - req.url_mut().query_pairs_mut().append_pair( - "definitionEnvironmentId", - &definition_environment_id.to_string(), - ); - } - if let Some(search_text) = &this.search_text { - req.url_mut() - .query_pairs_mut() - .append_pair("searchText", search_text); - } - if let Some(created_by) = &this.created_by { - req.url_mut() - .query_pairs_mut() - .append_pair("createdBy", created_by); - } - if let Some(status_filter) = &this.status_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("statusFilter", &status_filter.to_string()); - } - if let Some(environment_status_filter) = &this.environment_status_filter { - req.url_mut().query_pairs_mut().append_pair( - "environmentStatusFilter", - &environment_status_filter.to_string(), - ); - } - 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", &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", &formatted_date_time); - } - if let Some(query_order) = &this.query_order { - req.url_mut() - .query_pairs_mut() - .append_pair("queryOrder", &query_order.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", &continuation_token.to_string()); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - if let Some(artifact_type_id) = &this.artifact_type_id { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactTypeId", artifact_type_id); - } - if let Some(source_id) = &this.source_id { - req.url_mut() - .query_pairs_mut() - .append_pair("sourceId", source_id); - } - if let Some(artifact_version_id) = &this.artifact_version_id { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactVersionId", artifact_version_id); - } - if let Some(source_branch_filter) = &this.source_branch_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("sourceBranchFilter", source_branch_filter); - } - if let Some(is_deleted) = &this.is_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("isDeleted", &is_deleted.to_string()); - } - if let Some(tag_filter) = &this.tag_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("tagFilter", tag_filter); - } - if let Some(property_filters) = &this.property_filters { - req.url_mut() - .query_pairs_mut() - .append_pair("propertyFilters", property_filters); - } - if let Some(release_id_filter) = &this.release_id_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("releaseIdFilter", release_id_filter); - } - if let Some(path) = &this.path { - req.url_mut().query_pairs_mut().append_pair("path", path); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -926,12 +984,45 @@ pub mod releases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ReleaseStartMetadata, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -941,9 +1032,7 @@ pub mod releases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -955,26 +1044,24 @@ pub mod releases { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1022,13 +1109,51 @@ pub mod releases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, pub(crate) definition_snapshot_revision: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases/{}", + self.client.endpoint(), + self.organization, + self.project, + self.release_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1038,9 +1163,7 @@ pub mod releases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1052,31 +1175,24 @@ pub mod releases { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases/{}", - self.client.endpoint(), - self.organization, - self.project, - self.release_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1126,13 +1242,47 @@ pub mod releases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Release, pub(crate) project: String, pub(crate) release_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases/{}", + self.client.endpoint(), + self.organization, + self.project, + self.release_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1142,9 +1292,7 @@ pub mod releases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1156,27 +1304,24 @@ pub mod releases { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases/{}", - self.client.endpoint(), - self.organization, - self.project, - self.release_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1226,13 +1371,47 @@ pub mod releases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ReleaseUpdateMetadata, pub(crate) project: String, pub(crate) release_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases/{}", + self.client.endpoint(), + self.organization, + self.project, + self.release_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1242,9 +1421,7 @@ pub mod releases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1256,27 +1433,24 @@ pub mod releases { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases/{}", - self.client.endpoint(), - self.organization, - self.project, - self.release_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1326,21 +1500,61 @@ pub mod releases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, pub(crate) environment_id: i32, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A property that should be expanded in the environment."] pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/Release/releases/{}/environments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.release_id, + self.environment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] #[doc = "However, this function can provide more flexibility when required."] @@ -1348,9 +1562,7 @@ pub mod releases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1362,32 +1574,24 @@ pub mod releases { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/Release/releases/{}/environments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.release_id, - self.environment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1437,14 +1641,49 @@ pub mod releases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ReleaseEnvironmentUpdateMetadata, pub(crate) project: String, pub(crate) release_id: i32, pub(crate) environment_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/Release/releases/{}/environments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.release_id, + self.environment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1454,9 +1693,7 @@ pub mod releases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1468,28 +1705,24 @@ pub mod releases { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/Release/releases/{}/environments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.release_id, - self.environment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1537,8 +1770,12 @@ pub mod releases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, @@ -1548,7 +1785,7 @@ pub mod releases { pub(crate) start_line: Option, pub(crate) end_line: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Starting line number for logs"] pub fn start_line(mut self, start_line: i64) -> Self { self.start_line = Some(start_line); @@ -1559,6 +1796,40 @@ pub mod releases { self.end_line = Some(end_line); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(start_line) = &this.start_line { + req.url_mut() + .query_pairs_mut() + .append_pair("startLine", &start_line.to_string()); + } + if let Some(end_line) = &this.end_line { + req.url_mut() + .query_pairs_mut() + .append_pair("endLine", &end_line.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1567,9 +1838,7 @@ pub mod releases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1581,30 +1850,24 @@ pub mod releases { auth_header, ); } - if let Some(start_line) = &this.start_line { - req.url_mut() - .query_pairs_mut() - .append_pair("startLine", &start_line.to_string()); - } - if let Some(end_line) = &this.end_line { - req.url_mut() - .query_pairs_mut() - .append_pair("endLine", &end_line.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1652,12 +1915,45 @@ pub mod releases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/releases/{}/logs", + self.client.endpoint(), + self.organization, + self.project, + self.release_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1667,9 +1963,7 @@ pub mod releases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1681,26 +1975,24 @@ pub mod releases { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/releases/{}/logs", - self.client.endpoint(), - self.organization, - self.project, - self.release_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1806,8 +2098,12 @@ pub mod approvals { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) assigned_to_filter: Option, @@ -1819,7 +2115,7 @@ pub mod approvals { pub(crate) query_order: Option, pub(crate) include_my_group_approvals: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Approvals assigned to this user."] pub fn assigned_to_filter(mut self, assigned_to_filter: impl Into) -> Self { self.assigned_to_filter = Some(assigned_to_filter.into()); @@ -1866,6 +2162,76 @@ pub mod approvals { self.include_my_group_approvals = Some(include_my_group_approvals); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(assigned_to_filter) = &this.assigned_to_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("assignedToFilter", assigned_to_filter); + } + if let Some(status_filter) = &this.status_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("statusFilter", &status_filter.to_string()); + } + if let Some(release_ids_filter) = &this.release_ids_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseIdsFilter", release_ids_filter); + } + if let Some(type_filter) = &this.type_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("typeFilter", &type_filter.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", &continuation_token.to_string()); + } + if let Some(query_order) = &this.query_order { + req.url_mut() + .query_pairs_mut() + .append_pair("queryOrder", &query_order.to_string()); + } + if let Some(include_my_group_approvals) = &this.include_my_group_approvals { + req.url_mut().query_pairs_mut().append_pair( + "includeMyGroupApprovals", + &include_my_group_approvals.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/approvals", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1874,9 +2240,7 @@ pub mod approvals { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1888,66 +2252,24 @@ pub mod approvals { auth_header, ); } - if let Some(assigned_to_filter) = &this.assigned_to_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("assignedToFilter", assigned_to_filter); - } - if let Some(status_filter) = &this.status_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("statusFilter", &status_filter.to_string()); - } - if let Some(release_ids_filter) = &this.release_ids_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("releaseIdsFilter", release_ids_filter); - } - if let Some(type_filter) = &this.type_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("typeFilter", &type_filter.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", &continuation_token.to_string()); - } - if let Some(query_order) = &this.query_order { - req.url_mut() - .query_pairs_mut() - .append_pair("queryOrder", &query_order.to_string()); - } - if let Some(include_my_group_approvals) = &this.include_my_group_approvals { - req.url_mut().query_pairs_mut().append_pair( - "includeMyGroupApprovals", - &include_my_group_approvals.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/approvals", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1997,13 +2319,47 @@ pub mod approvals { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ReleaseApproval, pub(crate) project: String, pub(crate) approval_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/approvals/{}", + self.client.endpoint(), + self.organization, + self.project, + self.approval_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2013,9 +2369,7 @@ pub mod approvals { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2027,27 +2381,24 @@ pub mod approvals { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/approvals/{}", - self.client.endpoint(), - self.organization, - self.project, - self.approval_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2257,8 +2608,12 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) search_text: Option, @@ -2276,7 +2631,7 @@ pub mod definitions { pub(crate) is_deleted: Option, pub(crate) search_text_contains_folder_name: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Get release definitions with names containing searchText."] pub fn search_text(mut self, search_text: impl Into) -> Self { self.search_text = Some(search_text.into()); @@ -2353,6 +2708,106 @@ pub mod definitions { self.search_text_contains_folder_name = Some(search_text_contains_folder_name); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(search_text) = &this.search_text { + req.url_mut() + .query_pairs_mut() + .append_pair("searchText", search_text); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + if let Some(artifact_type) = &this.artifact_type { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactType", artifact_type); + } + if let Some(artifact_source_id) = &this.artifact_source_id { + req.url_mut() + .query_pairs_mut() + .append_pair("artifactSourceId", artifact_source_id); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(query_order) = &this.query_order { + req.url_mut() + .query_pairs_mut() + .append_pair("queryOrder", &query_order.to_string()); + } + if let Some(path) = &this.path { + req.url_mut().query_pairs_mut().append_pair("path", path); + } + if let Some(is_exact_name_match) = &this.is_exact_name_match { + req.url_mut() + .query_pairs_mut() + .append_pair("isExactNameMatch", &is_exact_name_match.to_string()); + } + if let Some(tag_filter) = &this.tag_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("tagFilter", tag_filter); + } + if let Some(property_filters) = &this.property_filters { + req.url_mut() + .query_pairs_mut() + .append_pair("propertyFilters", property_filters); + } + if let Some(definition_id_filter) = &this.definition_id_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("definitionIdFilter", definition_id_filter); + } + if let Some(is_deleted) = &this.is_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("isDeleted", &is_deleted.to_string()); + } + if let Some(search_text_contains_folder_name) = + &this.search_text_contains_folder_name + { + req.url_mut().query_pairs_mut().append_pair( + "searchTextContainsFolderName", + &search_text_contains_folder_name.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/definitions", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2361,9 +2816,7 @@ pub mod definitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2375,96 +2828,24 @@ pub mod definitions { auth_header, ); } - if let Some(search_text) = &this.search_text { - req.url_mut() - .query_pairs_mut() - .append_pair("searchText", search_text); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - if let Some(artifact_type) = &this.artifact_type { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactType", artifact_type); - } - if let Some(artifact_source_id) = &this.artifact_source_id { - req.url_mut() - .query_pairs_mut() - .append_pair("artifactSourceId", artifact_source_id); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(query_order) = &this.query_order { - req.url_mut() - .query_pairs_mut() - .append_pair("queryOrder", &query_order.to_string()); - } - if let Some(path) = &this.path { - req.url_mut().query_pairs_mut().append_pair("path", path); - } - if let Some(is_exact_name_match) = &this.is_exact_name_match { - req.url_mut() - .query_pairs_mut() - .append_pair("isExactNameMatch", &is_exact_name_match.to_string()); - } - if let Some(tag_filter) = &this.tag_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("tagFilter", tag_filter); - } - if let Some(property_filters) = &this.property_filters { - req.url_mut() - .query_pairs_mut() - .append_pair("propertyFilters", property_filters); - } - if let Some(definition_id_filter) = &this.definition_id_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("definitionIdFilter", definition_id_filter); - } - if let Some(is_deleted) = &this.is_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("isDeleted", &is_deleted.to_string()); - } - if let Some(search_text_contains_folder_name) = - &this.search_text_contains_folder_name - { - req.url_mut().query_pairs_mut().append_pair( - "searchTextContainsFolderName", - &search_text_contains_folder_name.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/definitions", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2514,12 +2895,45 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ReleaseDefinition, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/definitions", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2529,9 +2943,7 @@ pub mod definitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2543,26 +2955,24 @@ pub mod definitions { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/definitions", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2612,12 +3022,45 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ReleaseDefinition, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/definitions", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2627,9 +3070,7 @@ pub mod definitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2641,26 +3082,24 @@ pub mod definitions { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/definitions", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2710,19 +3149,58 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, pub(crate) property_filters: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definition will contain values for the specified property Ids (if they exist). If not set, properties will not be included."] pub fn property_filters(mut self, property_filters: impl Into) -> Self { self.property_filters = Some(property_filters.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(property_filters) = &this.property_filters { + req.url_mut() + .query_pairs_mut() + .append_pair("propertyFilters", property_filters); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/definitions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2731,9 +3209,7 @@ pub mod definitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2745,31 +3221,24 @@ pub mod definitions { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/definitions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2814,15 +3283,19 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, pub(crate) comment: Option, pub(crate) force_delete: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Comment for deleting a release definition."] pub fn comment(mut self, comment: impl Into) -> Self { self.comment = Some(comment.into()); @@ -2833,6 +3306,46 @@ pub mod definitions { self.force_delete = Some(force_delete); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + if let Some(comment) = &this.comment { + req.url_mut() + .query_pairs_mut() + .append_pair("comment", comment); + } + if let Some(force_delete) = &this.force_delete { + req.url_mut() + .query_pairs_mut() + .append_pair("forceDelete", &force_delete.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/definitions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2841,9 +3354,7 @@ pub mod definitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2855,36 +3366,24 @@ pub mod definitions { auth_header, ); } - if let Some(comment) = &this.comment { - req.url_mut() - .query_pairs_mut() - .append_pair("comment", comment); - } - if let Some(force_delete) = &this.force_delete { - req.url_mut() - .query_pairs_mut() - .append_pair("forceDelete", &force_delete.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/definitions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2940,12 +3439,45 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/Release/definitions/{}/revisions", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2955,9 +3487,7 @@ pub mod definitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2969,26 +3499,24 @@ pub mod definitions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/Release/definitions/{}/revisions", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3037,13 +3565,47 @@ pub mod definitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: i32, pub(crate) revision: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/Release/definitions/{}/revisions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.definition_id, + self.revision + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3053,9 +3615,7 @@ pub mod definitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3067,27 +3627,24 @@ pub mod definitions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/Release/definitions/{}/revisions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.definition_id, - self.revision - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3176,8 +3733,12 @@ pub mod deployments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition_id: Option, @@ -3196,7 +3757,7 @@ pub mod deployments { pub(crate) max_started_time: Option, pub(crate) source_branch: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn definition_id(mut self, definition_id: i32) -> Self { self.definition_id = Some(definition_id); self @@ -3278,118 +3839,100 @@ pub mod deployments { self.source_branch = Some(source_branch.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - if let Some(definition_id) = &this.definition_id { - req.url_mut() - .query_pairs_mut() - .append_pair("definitionId", &definition_id.to_string()); - } - if let Some(definition_environment_id) = &this.definition_environment_id { - req.url_mut().query_pairs_mut().append_pair( - "definitionEnvironmentId", - &definition_environment_id.to_string(), - ); - } - if let Some(created_by) = &this.created_by { - req.url_mut() - .query_pairs_mut() - .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", &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", &formatted_date_time); - } - if let Some(deployment_status) = &this.deployment_status { - req.url_mut() - .query_pairs_mut() - .append_pair("deploymentStatus", &deployment_status.to_string()); - } - if let Some(operation_status) = &this.operation_status { - req.url_mut() - .query_pairs_mut() - .append_pair("operationStatus", &operation_status.to_string()); - } - if let Some(latest_attempts_only) = &this.latest_attempts_only { - req.url_mut().query_pairs_mut().append_pair( - "latestAttemptsOnly", - &latest_attempts_only.to_string(), - ); - } - if let Some(query_order) = &this.query_order { - req.url_mut() - .query_pairs_mut() - .append_pair("queryOrder", &query_order.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", &continuation_token.to_string()); - } - if let Some(created_for) = &this.created_for { - req.url_mut() - .query_pairs_mut() - .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", &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", &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::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(definition_id) = &this.definition_id { + req.url_mut() + .query_pairs_mut() + .append_pair("definitionId", &definition_id.to_string()); + } + if let Some(definition_environment_id) = &this.definition_environment_id { + req.url_mut().query_pairs_mut().append_pair( + "definitionEnvironmentId", + &definition_environment_id.to_string(), + ); + } + if let Some(created_by) = &this.created_by { + req.url_mut() + .query_pairs_mut() + .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", &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", &formatted_date_time); + } + if let Some(deployment_status) = &this.deployment_status { + req.url_mut() + .query_pairs_mut() + .append_pair("deploymentStatus", &deployment_status.to_string()); + } + if let Some(operation_status) = &this.operation_status { + req.url_mut() + .query_pairs_mut() + .append_pair("operationStatus", &operation_status.to_string()); + } + if let Some(latest_attempts_only) = &this.latest_attempts_only { + req.url_mut() + .query_pairs_mut() + .append_pair("latestAttemptsOnly", &latest_attempts_only.to_string()); + } + if let Some(query_order) = &this.query_order { + req.url_mut() + .query_pairs_mut() + .append_pair("queryOrder", &query_order.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", &continuation_token.to_string()); + } + if let Some(created_for) = &this.created_for { + req.url_mut() + .query_pairs_mut() + .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", &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", &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::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -3406,6 +3949,47 @@ pub mod deployments { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -3546,14 +4130,18 @@ pub mod folders { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) path: String, pub(crate) query_order: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Gets the results in the defined order. Default is 'None'."] pub fn query_order( mut self, @@ -3562,6 +4150,41 @@ pub mod folders { self.query_order = Some(query_order.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(query_order) = &this.query_order { + req.url_mut() + .query_pairs_mut() + .append_pair("queryOrder", &query_order.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/folders/{}", + self.client.endpoint(), + self.organization, + self.project, + self.path + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3570,9 +4193,7 @@ pub mod folders { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3584,31 +4205,24 @@ pub mod folders { auth_header, ); } - if let Some(query_order) = &this.query_order { - req.url_mut() - .query_pairs_mut() - .append_pair("queryOrder", &query_order.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/folders/{}", - self.client.endpoint(), - self.organization, - self.project, - self.path - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3658,13 +4272,47 @@ pub mod folders { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Folder, pub(crate) project: String, pub(crate) path: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/folders/{}", + self.client.endpoint(), + self.organization, + self.project, + self.path + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3674,9 +4322,7 @@ pub mod folders { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3688,27 +4334,24 @@ pub mod folders { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/folders/{}", - self.client.endpoint(), - self.organization, - self.project, - self.path - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3758,13 +4401,47 @@ pub mod folders { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Folder, pub(crate) project: String, pub(crate) path: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/folders/{}", + self.client.endpoint(), + self.organization, + self.project, + self.path + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3774,9 +4451,7 @@ pub mod folders { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3788,27 +4463,24 @@ pub mod folders { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/folders/{}", - self.client.endpoint(), - self.organization, - self.project, - self.path - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3853,12 +4525,45 @@ pub mod folders { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) path: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/folders/{}", + self.client.endpoint(), + self.organization, + self.project, + self.path + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3868,9 +4573,7 @@ pub mod folders { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3882,26 +4585,24 @@ pub mod folders { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/folders/{}", - self.client.endpoint(), - self.organization, - self.project, - self.path - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3986,13 +4687,47 @@ pub mod gates { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::GateUpdateMetadata, pub(crate) project: String, pub(crate) gate_step_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/release/gates/{}", + self.client.endpoint(), + self.organization, + self.project, + self.gate_step_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4002,9 +4737,7 @@ pub mod gates { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4016,27 +4749,24 @@ pub mod gates { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/release/gates/{}", - self.client.endpoint(), - self.organization, - self.project, - self.gate_step_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4238,8 +4968,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, @@ -4248,6 +4982,29 @@ pub mod attachments { pub(crate) plan_id: String, pub(crate) type_: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4257,9 +5014,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4271,20 +5026,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4333,8 +5092,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, @@ -4346,8 +5109,31 @@ pub mod attachments { pub(crate) type_: String, pub(crate) name: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] #[doc = "However, this function can provide more flexibility when required."] @@ -4355,9 +5141,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4369,20 +5153,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4435,8 +5223,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, @@ -4445,6 +5237,29 @@ pub mod attachments { pub(crate) timeline_id: String, pub(crate) type_: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4454,9 +5269,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4468,20 +5281,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4530,8 +5347,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, @@ -4542,6 +5363,29 @@ pub mod attachments { pub(crate) type_: String, pub(crate) name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4551,9 +5395,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4565,20 +5407,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4707,12 +5553,45 @@ pub mod manual_interventions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/Release/releases/{}/manualinterventions", + self.client.endpoint(), + self.organization, + self.project, + self.release_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4722,9 +5601,7 @@ pub mod manual_interventions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4736,26 +5613,24 @@ pub mod manual_interventions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/Release/releases/{}/manualinterventions", - self.client.endpoint(), - self.organization, - self.project, - self.release_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4806,13 +5681,47 @@ pub mod manual_interventions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, pub(crate) manual_intervention_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.release_id, + self.manual_intervention_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4822,9 +5731,7 @@ pub mod manual_interventions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4836,27 +5743,24 @@ pub mod manual_interventions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.release_id, - self.manual_intervention_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4906,14 +5810,49 @@ pub mod manual_interventions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ManualInterventionUpdateMetadata, pub(crate) project: String, pub(crate) release_id: i32, pub(crate) manual_intervention_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.release_id, + self.manual_intervention_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4923,9 +5862,7 @@ pub mod manual_interventions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4937,28 +5874,24 @@ pub mod manual_interventions { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.release_id, - self.manual_intervention_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4975,3 +5908,809 @@ pub mod manual_interventions { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn approvals_client(&self) -> approvals::Client { + approvals::Client(self.clone()) + } + pub fn attachments_client(&self) -> attachments::Client { + attachments::Client(self.clone()) + } + pub fn definitions_client(&self) -> definitions::Client { + definitions::Client(self.clone()) + } + pub fn deployments_client(&self) -> deployments::Client { + deployments::Client(self.clone()) + } + pub fn folders_client(&self) -> folders::Client { + folders::Client(self.clone()) + } + pub fn gates_client(&self) -> gates::Client { + gates::Client(self.clone()) + } + pub fn manual_interventions_client(&self) -> manual_interventions::Client { + manual_interventions::Client(self.clone()) + } + pub fn releases_client(&self) -> releases::Client { + releases::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod releases { + use super::super::models; + use super::super::releases::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a Release"] + #[doc = ""] + #[doc = "See [`get_release`](super::super::releases::Client::get_release) for details of the arguments."] + pub fn get_release( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + ) -> get_release::RequestBuilder { + get_release::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + approval_filters: None, + property_filters: None, + expand: None, + top_gate_records: None, + } + } + #[doc = "Get a list of releases"] + #[doc = ""] + #[doc = "See [`list`](super::super::releases::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id: None, + definition_environment_id: None, + search_text: None, + created_by: None, + status_filter: None, + environment_status_filter: None, + min_created_time: None, + max_created_time: None, + query_order: None, + top: None, + continuation_token: None, + expand: None, + artifact_type_id: None, + source_id: None, + artifact_version_id: None, + source_branch_filter: None, + is_deleted: None, + tag_filter: None, + property_filters: None, + release_id_filter: None, + path: None, + } + } + #[doc = "Create a release."] + #[doc = ""] + #[doc = "See [`create`](super::super::releases::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get release for a given revision number."] + #[doc = ""] + #[doc = "See [`get_release_revision`](super::super::releases::Client::get_release_revision) for details of the arguments."] + pub fn get_release_revision( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + definition_snapshot_revision: i32, + ) -> get_release_revision::RequestBuilder { + get_release_revision::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + definition_snapshot_revision, + } + } + #[doc = "Update a complete release object."] + #[doc = ""] + #[doc = "See [`update_release`](super::super::releases::Client::update_release) for details of the arguments."] + pub fn update_release( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + release_id: i32, + ) -> update_release::RequestBuilder { + update_release::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + release_id, + } + } + #[doc = "Update few properties of a release."] + #[doc = ""] + #[doc = "See [`update_release_resource`](super::super::releases::Client::update_release_resource) for details of the arguments."] + pub fn update_release_resource( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + release_id: i32, + ) -> update_release_resource::RequestBuilder { + update_release_resource::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + release_id, + } + } + #[doc = "Get a release environment."] + #[doc = ""] + #[doc = "See [`get_release_environment`](super::super::releases::Client::get_release_environment) for details of the arguments."] + pub fn get_release_environment( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + environment_id: i32, + ) -> get_release_environment::RequestBuilder { + get_release_environment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + environment_id, + expand: None, + } + } + #[doc = "Update the status of a release environment"] + #[doc = ""] + #[doc = "See [`update_release_environment`](super::super::releases::Client::update_release_environment) for details of the arguments."] + pub fn update_release_environment( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + release_id: i32, + environment_id: i32, + ) -> update_release_environment::RequestBuilder { + update_release_environment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + release_id, + environment_id, + } + } + #[doc = "Gets the task log of a release as a plain text file."] + #[doc = ""] + #[doc = "See [`get_task_log`](super::super::releases::Client::get_task_log) for details of the arguments."] + pub fn get_task_log( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + environment_id: i32, + release_deploy_phase_id: i32, + task_id: i32, + ) -> get_task_log::RequestBuilder { + get_task_log::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + environment_id, + release_deploy_phase_id, + task_id, + start_line: None, + end_line: None, + } + } + #[doc = "Get logs for a release Id."] + #[doc = ""] + #[doc = "See [`get_logs`](super::super::releases::Client::get_logs) for details of the arguments."] + pub fn get_logs( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + ) -> get_logs::RequestBuilder { + get_logs::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + } + } + } + } + pub mod approvals { + use super::super::approvals::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of approvals"] + #[doc = ""] + #[doc = "See [`list`](super::super::approvals::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + assigned_to_filter: None, + status_filter: None, + release_ids_filter: None, + type_filter: None, + top: None, + continuation_token: None, + query_order: None, + include_my_group_approvals: None, + } + } + #[doc = "Update status of an approval"] + #[doc = ""] + #[doc = "See [`update`](super::super::approvals::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + approval_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + approval_id, + } + } + } + } + pub mod definitions { + use super::super::definitions::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of release definitions."] + #[doc = ""] + #[doc = "See [`list`](super::super::definitions::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + search_text: None, + expand: None, + artifact_type: None, + artifact_source_id: None, + top: None, + continuation_token: None, + query_order: None, + path: None, + is_exact_name_match: None, + tag_filter: None, + property_filters: None, + definition_id_filter: None, + is_deleted: None, + search_text_contains_folder_name: None, + } + } + #[doc = "Create a release definition"] + #[doc = ""] + #[doc = "See [`create`](super::super::definitions::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Update a release definition."] + #[doc = ""] + #[doc = "See [`update`](super::super::definitions::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get a release definition."] + #[doc = ""] + #[doc = "See [`get`](super::super::definitions::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + property_filters: None, + } + } + #[doc = "Delete a release definition."] + #[doc = ""] + #[doc = "See [`delete`](super::super::definitions::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + comment: None, + force_delete: None, + } + } + #[doc = "Get revision history for a release definition"] + #[doc = ""] + #[doc = "See [`get_release_definition_history`](super::super::definitions::Client::get_release_definition_history) for details of the arguments."] + pub fn get_release_definition_history( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + ) -> get_release_definition_history::RequestBuilder { + get_release_definition_history::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + } + } + #[doc = "Get release definition for a given definition_id and revision"] + #[doc = ""] + #[doc = "See [`get_definition_revision`](super::super::definitions::Client::get_definition_revision) for details of the arguments."] + pub fn get_definition_revision( + &self, + organization: impl Into, + project: impl Into, + definition_id: i32, + revision: i32, + ) -> get_definition_revision::RequestBuilder { + get_definition_revision::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id, + revision, + } + } + } + } + pub mod deployments { + use super::super::deployments::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`list`](super::super::deployments::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition_id: None, + definition_environment_id: None, + created_by: None, + min_modified_time: None, + max_modified_time: None, + deployment_status: None, + operation_status: None, + latest_attempts_only: None, + query_order: None, + top: None, + continuation_token: None, + created_for: None, + min_started_time: None, + max_started_time: None, + source_branch: None, + } + } + } + } + pub mod folders { + use super::super::folders::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets folders."] + #[doc = ""] + #[doc = "See [`list`](super::super::folders::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + path: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + path: path.into(), + query_order: None, + } + } + #[doc = "This method is no longer supported. Use CreateFolder with folder parameter API."] + #[doc = ""] + #[doc = "See [`create`](super::super::folders::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + path: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + path: path.into(), + } + } + #[doc = "Updates an existing folder at given existing path."] + #[doc = ""] + #[doc = "See [`update`](super::super::folders::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + path: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + path: path.into(), + } + } + #[doc = "Deletes a definition folder for given folder name and path and all it's existing definitions."] + #[doc = ""] + #[doc = "See [`delete`](super::super::folders::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + path: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + path: path.into(), + } + } + } + } + pub mod gates { + use super::super::gates::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Updates the gate for a deployment."] + #[doc = ""] + #[doc = "See [`update`](super::super::gates::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + gate_step_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + gate_step_id, + } + } + } + } + pub mod attachments { + use super::super::attachments::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the release task attachments."] + #[doc = ""] + #[doc = "See [`get_release_task_attachments`](super::super::attachments::Client::get_release_task_attachments) for details of the arguments."] + pub fn get_release_task_attachments( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + environment_id: i32, + attempt_id: i32, + plan_id: impl Into, + type_: impl Into, + ) -> get_release_task_attachments::RequestBuilder { + get_release_task_attachments::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + environment_id, + attempt_id, + plan_id: plan_id.into(), + type_: type_.into(), + } + } + #[doc = "Get a release task attachment."] + #[doc = ""] + #[doc = "See [`get_release_task_attachment_content`](super::super::attachments::Client::get_release_task_attachment_content) for details of the arguments."] + pub fn get_release_task_attachment_content( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + environment_id: i32, + attempt_id: i32, + plan_id: impl Into, + timeline_id: impl Into, + record_id: impl Into, + type_: impl Into, + name: impl Into, + ) -> get_release_task_attachment_content::RequestBuilder { + get_release_task_attachment_content::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + environment_id, + attempt_id, + plan_id: plan_id.into(), + timeline_id: timeline_id.into(), + record_id: record_id.into(), + type_: type_.into(), + name: name.into(), + } + } + #[doc = "GetTaskAttachments API is deprecated. Use GetReleaseTaskAttachments API instead."] + #[doc = ""] + #[doc = "See [`get_task_attachments`](super::super::attachments::Client::get_task_attachments) for details of the arguments."] + pub fn get_task_attachments( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + environment_id: i32, + attempt_id: i32, + timeline_id: impl Into, + type_: impl Into, + ) -> get_task_attachments::RequestBuilder { + get_task_attachments::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + environment_id, + attempt_id, + timeline_id: timeline_id.into(), + type_: type_.into(), + } + } + #[doc = "GetTaskAttachmentContent API is deprecated. Use GetReleaseTaskAttachmentContent API instead."] + #[doc = ""] + #[doc = "See [`get_task_attachment_content`](super::super::attachments::Client::get_task_attachment_content) for details of the arguments."] + pub fn get_task_attachment_content( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + environment_id: i32, + attempt_id: i32, + timeline_id: impl Into, + record_id: impl Into, + type_: impl Into, + name: impl Into, + ) -> get_task_attachment_content::RequestBuilder { + get_task_attachment_content::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + environment_id, + attempt_id, + timeline_id: timeline_id.into(), + record_id: record_id.into(), + type_: type_.into(), + name: name.into(), + } + } + } + } + pub mod manual_interventions { + use super::super::manual_interventions::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all manual interventions for a given release."] + #[doc = ""] + #[doc = "See [`list`](super::super::manual_interventions::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + } + } + #[doc = "Get manual intervention for a given release and manual intervention id."] + #[doc = ""] + #[doc = "See [`get`](super::super::manual_interventions::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + manual_intervention_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + manual_intervention_id, + } + } + #[doc = "Update manual intervention."] + #[doc = ""] + #[doc = "See [`update`](super::super::manual_interventions::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + release_id: i32, + manual_intervention_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + release_id, + manual_intervention_id, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/search/mod.rs b/azure_devops_rust_api/src/search/mod.rs index e75b4949..3ce40701 100644 --- a/azure_devops_rust_api/src/search/mod.rs +++ b/azure_devops_rust_api/src/search/mod.rs @@ -223,11 +223,43 @@ pub mod package_search_results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PackageSearchRequest, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -237,9 +269,7 @@ pub mod package_search_results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -251,25 +281,24 @@ pub mod package_search_results { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -349,12 +378,45 @@ pub mod code_search_results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CodeSearchRequest, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/search/codesearchresults", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -364,9 +426,7 @@ pub mod code_search_results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -378,26 +438,24 @@ pub mod code_search_results { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/search/codesearchresults", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -479,12 +537,45 @@ pub mod repositories { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) repository: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/search/status/repositories/{}", + self.client.endpoint(), + self.organization, + self.project, + self.repository + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -494,9 +585,7 @@ pub mod repositories { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -508,26 +597,24 @@ pub mod repositories { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/search/status/repositories/{}", - self.client.endpoint(), - self.organization, - self.project, - self.repository - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -607,11 +694,43 @@ pub mod tfvc { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/search/status/tfvc", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -621,9 +740,7 @@ pub mod tfvc { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -635,25 +752,24 @@ pub mod tfvc { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/search/status/tfvc", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -733,12 +849,45 @@ pub mod wiki_search_results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WikiSearchRequest, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/search/wikisearchresults", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -748,9 +897,7 @@ pub mod wiki_search_results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -762,26 +909,24 @@ pub mod wiki_search_results { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/search/wikisearchresults", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -863,12 +1008,45 @@ pub mod work_item_search_results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemSearchRequest, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/search/workitemsearchresults", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -878,9 +1056,7 @@ pub mod work_item_search_results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -892,26 +1068,24 @@ pub mod work_item_search_results { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/search/workitemsearchresults", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -929,3 +1103,234 @@ pub mod work_item_search_results { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn code_search_results_client(&self) -> code_search_results::Client { + code_search_results::Client(self.clone()) + } + pub fn package_search_results_client(&self) -> package_search_results::Client { + package_search_results::Client(self.clone()) + } + pub fn repositories_client(&self) -> repositories::Client { + repositories::Client(self.clone()) + } + pub fn tfvc_client(&self) -> tfvc::Client { + tfvc::Client(self.clone()) + } + pub fn wiki_search_results_client(&self) -> wiki_search_results::Client { + wiki_search_results::Client(self.clone()) + } + pub fn work_item_search_results_client(&self) -> work_item_search_results::Client { + work_item_search_results::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod package_search_results { + use super::super::models; + use super::super::package_search_results::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Provides a set of results for the search text."] + #[doc = ""] + #[doc = "See [`fetch_package_search_results`](super::super::package_search_results::Client::fetch_package_search_results) for details of the arguments."] + pub fn fetch_package_search_results( + &self, + organization: impl Into, + body: impl Into, + ) -> fetch_package_search_results::RequestBuilder { + fetch_package_search_results::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + } + } + pub mod code_search_results { + use super::super::code_search_results::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Provides a set of results for the search text."] + #[doc = ""] + #[doc = "See [`fetch_code_search_results`](super::super::code_search_results::Client::fetch_code_search_results) for details of the arguments."] + pub fn fetch_code_search_results( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> fetch_code_search_results::RequestBuilder { + fetch_code_search_results::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod repositories { + use super::super::models; + use super::super::repositories::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Provides status of Repository."] + #[doc = ""] + #[doc = "See [`get`](super::super::repositories::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + repository: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + repository: repository.into(), + } + } + } + } + pub mod tfvc { + use super::super::models; + use super::super::tfvc::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Provides status of TFVC Repository."] + #[doc = ""] + #[doc = "See [`get`](super::super::tfvc::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + } + } + pub mod wiki_search_results { + use super::super::models; + use super::super::wiki_search_results::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Provides a set of results for the search request."] + #[doc = ""] + #[doc = "See [`fetch_wiki_search_results`](super::super::wiki_search_results::Client::fetch_wiki_search_results) for details of the arguments."] + pub fn fetch_wiki_search_results( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> fetch_wiki_search_results::RequestBuilder { + fetch_wiki_search_results::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod work_item_search_results { + use super::super::models; + use super::super::work_item_search_results::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Provides a set of results for the search text."] + #[doc = ""] + #[doc = "See [`fetch_work_item_search_results`](super::super::work_item_search_results::Client::fetch_work_item_search_results) for details of the arguments."] + pub fn fetch_work_item_search_results( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> fetch_work_item_search_results::RequestBuilder { + fetch_work_item_search_results::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/security/mod.rs b/azure_devops_rust_api/src/security/mod.rs index df0ceb64..1486b816 100644 --- a/azure_devops_rust_api/src/security/mod.rs +++ b/azure_devops_rust_api/src/security/mod.rs @@ -225,12 +225,45 @@ pub mod access_control_entries { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) body: serde_json::Value, pub(crate) security_namespace_id: String, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/accesscontrolentries/{}", + self.client.endpoint(), + self.organization, + self.security_namespace_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -240,9 +273,7 @@ pub mod access_control_entries { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -254,26 +285,24 @@ pub mod access_control_entries { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/accesscontrolentries/{}", - self.client.endpoint(), - self.organization, - self.security_namespace_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -322,14 +351,18 @@ pub mod access_control_entries { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) security_namespace_id: String, pub(crate) organization: String, pub(crate) token: Option, pub(crate) descriptors: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The token whose ACL should be modified."] pub fn token(mut self, token: impl Into) -> Self { self.token = Some(token.into()); @@ -340,6 +373,43 @@ pub mod access_control_entries { self.descriptors = Some(descriptors.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + if let Some(token) = &this.token { + req.url_mut().query_pairs_mut().append_pair("token", token); + } + if let Some(descriptors) = &this.descriptors { + req.url_mut() + .query_pairs_mut() + .append_pair("descriptors", descriptors); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/accesscontrolentries/{}", + self.client.endpoint(), + self.organization, + self.security_namespace_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -348,9 +418,7 @@ pub mod access_control_entries { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -362,33 +430,24 @@ pub mod access_control_entries { auth_header, ); } - if let Some(token) = &this.token { - req.url_mut().query_pairs_mut().append_pair("token", token); - } - if let Some(descriptors) = &this.descriptors { - req.url_mut() - .query_pairs_mut() - .append_pair("descriptors", descriptors); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/accesscontrolentries/{}", - self.client.endpoint(), - self.organization, - self.security_namespace_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -505,8 +564,12 @@ pub mod access_control_lists { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) security_namespace_id: String, pub(crate) organization: String, pub(crate) token: Option, @@ -514,7 +577,7 @@ pub mod access_control_lists { pub(crate) include_extended_info: Option, pub(crate) recurse: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Security token"] pub fn token(mut self, token: impl Into) -> Self { self.token = Some(token.into()); @@ -535,6 +598,53 @@ pub mod access_control_lists { self.recurse = Some(recurse); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(token) = &this.token { + req.url_mut().query_pairs_mut().append_pair("token", token); + } + if let Some(descriptors) = &this.descriptors { + req.url_mut() + .query_pairs_mut() + .append_pair("descriptors", descriptors); + } + if let Some(include_extended_info) = &this.include_extended_info { + req.url_mut() + .query_pairs_mut() + .append_pair("includeExtendedInfo", &include_extended_info.to_string()); + } + if let Some(recurse) = &this.recurse { + req.url_mut() + .query_pairs_mut() + .append_pair("recurse", &recurse.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/accesscontrollists/{}", + self.client.endpoint(), + self.organization, + self.security_namespace_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -543,9 +653,7 @@ pub mod access_control_lists { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -557,44 +665,24 @@ pub mod access_control_lists { auth_header, ); } - if let Some(token) = &this.token { - req.url_mut().query_pairs_mut().append_pair("token", token); - } - if let Some(descriptors) = &this.descriptors { - req.url_mut() - .query_pairs_mut() - .append_pair("descriptors", descriptors); - } - if let Some(include_extended_info) = &this.include_extended_info { - req.url_mut().query_pairs_mut().append_pair( - "includeExtendedInfo", - &include_extended_info.to_string(), - ); - } - if let Some(recurse) = &this.recurse { - req.url_mut() - .query_pairs_mut() - .append_pair("recurse", &recurse.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/accesscontrollists/{}", - self.client.endpoint(), - self.organization, - self.security_namespace_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -639,12 +727,45 @@ pub mod access_control_lists { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) body: models::AccessControlListBody, pub(crate) security_namespace_id: String, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/accesscontrollists/{}", + self.client.endpoint(), + self.organization, + self.security_namespace_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -654,9 +775,7 @@ pub mod access_control_lists { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -668,26 +787,24 @@ pub mod access_control_lists { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/accesscontrollists/{}", - self.client.endpoint(), - self.organization, - self.security_namespace_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -738,14 +855,18 @@ pub mod access_control_lists { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) security_namespace_id: String, pub(crate) organization: String, pub(crate) tokens: Option, pub(crate) recurse: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "One or more comma-separated security tokens"] pub fn tokens(mut self, tokens: impl Into) -> Self { self.tokens = Some(tokens.into()); @@ -756,6 +877,45 @@ pub mod access_control_lists { self.recurse = Some(recurse); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + if let Some(tokens) = &this.tokens { + req.url_mut() + .query_pairs_mut() + .append_pair("tokens", tokens); + } + if let Some(recurse) = &this.recurse { + req.url_mut() + .query_pairs_mut() + .append_pair("recurse", &recurse.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/accesscontrollists/{}", + self.client.endpoint(), + self.organization, + self.security_namespace_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -764,9 +924,7 @@ pub mod access_control_lists { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -778,35 +936,24 @@ pub mod access_control_lists { auth_header, ); } - if let Some(tokens) = &this.tokens { - req.url_mut() - .query_pairs_mut() - .append_pair("tokens", tokens); - } - if let Some(recurse) = &this.recurse { - req.url_mut() - .query_pairs_mut() - .append_pair("recurse", &recurse.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/accesscontrollists/{}", - self.client.endpoint(), - self.organization, - self.security_namespace_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -925,8 +1072,12 @@ pub mod permissions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) security_namespace_id: String, pub(crate) organization: String, pub(crate) permissions: i32, @@ -934,7 +1085,7 @@ pub mod permissions { pub(crate) always_allow_administrators: Option, pub(crate) delimiter: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "One or more security tokens to evaluate."] pub fn tokens(mut self, tokens: impl Into) -> Self { self.tokens = Some(tokens.into()); @@ -953,6 +1104,52 @@ pub mod permissions { self.delimiter = Some(delimiter.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(tokens) = &this.tokens { + req.url_mut() + .query_pairs_mut() + .append_pair("tokens", tokens); + } + if let Some(always_allow_administrators) = &this.always_allow_administrators { + req.url_mut().query_pairs_mut().append_pair( + "alwaysAllowAdministrators", + &always_allow_administrators.to_string(), + ); + } + if let Some(delimiter) = &this.delimiter { + req.url_mut() + .query_pairs_mut() + .append_pair("delimiter", delimiter); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/permissions/{}/{}", + self.client.endpoint(), + self.organization, + self.security_namespace_id, + self.permissions + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -961,9 +1158,7 @@ pub mod permissions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -975,43 +1170,24 @@ pub mod permissions { auth_header, ); } - if let Some(tokens) = &this.tokens { - req.url_mut() - .query_pairs_mut() - .append_pair("tokens", tokens); - } - if let Some(always_allow_administrators) = &this.always_allow_administrators - { - req.url_mut().query_pairs_mut().append_pair( - "alwaysAllowAdministrators", - &always_allow_administrators.to_string(), - ); - } - if let Some(delimiter) = &this.delimiter { - req.url_mut() - .query_pairs_mut() - .append_pair("delimiter", delimiter); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/permissions/{}/{}", - self.client.endpoint(), - self.organization, - self.security_namespace_id, - self.permissions - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1061,20 +1237,61 @@ pub mod permissions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) security_namespace_id: String, pub(crate) descriptor: String, pub(crate) organization: String, pub(crate) permissions: i32, pub(crate) token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Security token to remove permissions for."] pub fn token(mut self, token: impl Into) -> Self { self.token = Some(token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let descriptor = &this.descriptor; + req.url_mut() + .query_pairs_mut() + .append_pair("descriptor", descriptor); + if let Some(token) = &this.token { + req.url_mut().query_pairs_mut().append_pair("token", token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/permissions/{}/{}", + self.client.endpoint(), + self.organization, + self.security_namespace_id, + self.permissions + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1083,9 +1300,7 @@ pub mod permissions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1097,33 +1312,24 @@ pub mod permissions { auth_header, ); } - let descriptor = &this.descriptor; - req.url_mut() - .query_pairs_mut() - .append_pair("descriptor", descriptor); - if let Some(token) = &this.token { - req.url_mut().query_pairs_mut().append_pair("token", token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/permissions/{}/{}", - self.client.endpoint(), - self.organization, - self.security_namespace_id, - self.permissions - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1176,11 +1382,43 @@ pub mod permissions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) body: models::PermissionEvaluationBatch, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1190,9 +1428,7 @@ pub mod permissions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1204,25 +1440,24 @@ pub mod permissions { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1303,18 +1538,56 @@ pub mod security_namespaces { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) security_namespace_id: String, pub(crate) local_only: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If true, retrieve only local security namespaces."] pub fn local_only(mut self, local_only: bool) -> Self { self.local_only = Some(local_only); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/securitynamespaces/{}", + self.client.endpoint(), + self.organization, + self.security_namespace_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1323,9 +1596,7 @@ pub mod security_namespaces { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1337,30 +1608,24 @@ pub mod security_namespaces { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/securitynamespaces/{}", - self.client.endpoint(), - self.organization, - self.security_namespace_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1378,3 +1643,271 @@ pub mod security_namespaces { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn access_control_entries_client(&self) -> access_control_entries::Client { + access_control_entries::Client(self.clone()) + } + pub fn access_control_lists_client(&self) -> access_control_lists::Client { + access_control_lists::Client(self.clone()) + } + pub fn permissions_client(&self) -> permissions::Client { + permissions::Client(self.clone()) + } + pub fn security_namespaces_client(&self) -> security_namespaces::Client { + security_namespaces::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod access_control_entries { + use super::super::access_control_entries::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Add or update ACEs in the ACL for the provided token. The request body contains the target token, a list of [ACEs](https://docs.microsoft.com/en-us/rest/api/azure/devops/security/access%20control%20entries/set%20access%20control%20entries?#accesscontrolentry) and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the \"merge\" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced."] + #[doc = ""] + #[doc = "See [`set_access_control_entries`](super::super::access_control_entries::Client::set_access_control_entries) for details of the arguments."] + pub fn set_access_control_entries( + &self, + body: impl Into, + security_namespace_id: impl Into, + organization: impl Into, + ) -> set_access_control_entries::RequestBuilder { + set_access_control_entries::RequestBuilder { + client: self.0.clone(), + body: body.into(), + security_namespace_id: security_namespace_id.into(), + organization: organization.into(), + } + } + #[doc = "Remove the specified ACEs from the ACL belonging to the specified token."] + #[doc = ""] + #[doc = "See [`remove_access_control_entries`](super::super::access_control_entries::Client::remove_access_control_entries) for details of the arguments."] + pub fn remove_access_control_entries( + &self, + security_namespace_id: impl Into, + organization: impl Into, + ) -> remove_access_control_entries::RequestBuilder { + remove_access_control_entries::RequestBuilder { + client: self.0.clone(), + security_namespace_id: security_namespace_id.into(), + organization: organization.into(), + token: None, + descriptors: None, + } + } + } + } + pub mod access_control_lists { + use super::super::access_control_lists::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided."] + #[doc = ""] + #[doc = "See [`query`](super::super::access_control_lists::Client::query) for details of the arguments."] + pub fn query( + &self, + security_namespace_id: impl Into, + organization: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + security_namespace_id: security_namespace_id.into(), + organization: organization.into(), + token: None, + descriptors: None, + include_extended_info: None, + recurse: None, + } + } + #[doc = "Create or update one or more access control lists. All data that currently exists for the ACLs supplied will be overwritten."] + #[doc = ""] + #[doc = "See [`set_access_control_lists`](super::super::access_control_lists::Client::set_access_control_lists) for details of the arguments."] + pub fn set_access_control_lists( + &self, + body: impl Into, + security_namespace_id: impl Into, + organization: impl Into, + ) -> set_access_control_lists::RequestBuilder { + set_access_control_lists::RequestBuilder { + client: self.0.clone(), + body: body.into(), + security_namespace_id: security_namespace_id.into(), + organization: organization.into(), + } + } + #[doc = "Remove access control lists under the specfied security namespace."] + #[doc = ""] + #[doc = "See [`remove_access_control_lists`](super::super::access_control_lists::Client::remove_access_control_lists) for details of the arguments."] + pub fn remove_access_control_lists( + &self, + security_namespace_id: impl Into, + organization: impl Into, + ) -> remove_access_control_lists::RequestBuilder { + remove_access_control_lists::RequestBuilder { + client: self.0.clone(), + security_namespace_id: security_namespace_id.into(), + organization: organization.into(), + tokens: None, + recurse: None, + } + } + } + } + pub mod permissions { + use super::super::models; + use super::super::permissions::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Evaluates whether the caller has the specified permissions on the specified set of security tokens."] + #[doc = ""] + #[doc = "See [`has_permissions`](super::super::permissions::Client::has_permissions) for details of the arguments."] + pub fn has_permissions( + &self, + security_namespace_id: impl Into, + organization: impl Into, + permissions: i32, + ) -> has_permissions::RequestBuilder { + has_permissions::RequestBuilder { + client: self.0.clone(), + security_namespace_id: security_namespace_id.into(), + organization: organization.into(), + permissions, + tokens: None, + always_allow_administrators: None, + delimiter: None, + } + } + #[doc = "Removes the specified permissions on a security token for a user or group."] + #[doc = ""] + #[doc = "See [`remove_permission`](super::super::permissions::Client::remove_permission) for details of the arguments."] + pub fn remove_permission( + &self, + security_namespace_id: impl Into, + descriptor: impl Into, + organization: impl Into, + permissions: i32, + ) -> remove_permission::RequestBuilder { + remove_permission::RequestBuilder { + client: self.0.clone(), + security_namespace_id: security_namespace_id.into(), + descriptor: descriptor.into(), + organization: organization.into(), + permissions, + token: None, + } + } + #[doc = "Evaluates multiple permissions for the calling user. Note: This method does not aggregate the results, nor does it short-circuit if one of the permissions evaluates to false."] + #[doc = ""] + #[doc = "See [`has_permissions_batch`](super::super::permissions::Client::has_permissions_batch) for details of the arguments."] + pub fn has_permissions_batch( + &self, + body: impl Into, + organization: impl Into, + ) -> has_permissions_batch::RequestBuilder { + has_permissions_batch::RequestBuilder { + client: self.0.clone(), + body: body.into(), + organization: organization.into(), + } + } + } + } + pub mod security_namespaces { + use super::super::models; + use super::super::security_namespaces::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all security namespaces or just the specified namespace."] + #[doc = ""] + #[doc = "See [`query`](super::super::security_namespaces::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + security_namespace_id: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + security_namespace_id: security_namespace_id.into(), + local_only: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/security_roles/mod.rs b/azure_devops_rust_api/src/security_roles/mod.rs index f16f66c4..861cce79 100644 --- a/azure_devops_rust_api/src/security_roles/mod.rs +++ b/azure_devops_rust_api/src/security_roles/mod.rs @@ -297,13 +297,44 @@ pub mod roleassignments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) scope_id: String, pub(crate) resource_id: String, pub(crate) inherit_permissions: bool, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let inherit_permissions = &this.inherit_permissions; + req.url_mut() + .query_pairs_mut() + .append_pair("inheritPermissions", &inherit_permissions.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -313,9 +344,7 @@ pub mod roleassignments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -327,24 +356,24 @@ pub mod roleassignments { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -397,12 +426,45 @@ pub mod roleassignments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) scope_id: String, pub(crate) resource_id: String, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", + self.client.endpoint(), + self.organization, + self.scope_id, + self.resource_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -412,9 +474,7 @@ pub mod roleassignments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -426,26 +486,24 @@ pub mod roleassignments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", - self.client.endpoint(), - self.organization, - self.scope_id, - self.resource_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -495,15 +553,19 @@ pub mod roleassignments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) body: Vec, pub(crate) scope_id: String, pub(crate) resource_id: String, pub(crate) organization: String, pub(crate) limit_to_caller_identity_domain: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn limit_to_caller_identity_domain( mut self, limit_to_caller_identity_domain: bool, @@ -511,6 +573,44 @@ pub mod roleassignments { self.limit_to_caller_identity_domain = Some(limit_to_caller_identity_domain); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + if let Some(limit_to_caller_identity_domain) = &this.limit_to_caller_identity_domain + { + req.url_mut().query_pairs_mut().append_pair( + "limitToCallerIdentityDomain", + &limit_to_caller_identity_domain.to_string(), + ); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", + self.client.endpoint(), + self.organization, + self.scope_id, + self.resource_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -519,9 +619,7 @@ pub mod roleassignments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -533,35 +631,24 @@ pub mod roleassignments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - if let Some(limit_to_caller_identity_domain) = - &this.limit_to_caller_identity_domain - { - req.url_mut().query_pairs_mut().append_pair( - "limitToCallerIdentityDomain", - &limit_to_caller_identity_domain.to_string(), - ); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", - self.client.endpoint(), - self.organization, - self.scope_id, - self.resource_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -606,13 +693,47 @@ pub mod roleassignments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) body: Vec, pub(crate) scope_id: String, pub(crate) resource_id: String, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", + self.client.endpoint(), + self.organization, + self.scope_id, + self.resource_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -622,9 +743,7 @@ pub mod roleassignments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -636,27 +755,24 @@ pub mod roleassignments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}", - self.client.endpoint(), - self.organization, - self.scope_id, - self.resource_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -709,14 +825,49 @@ pub mod roleassignments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) body: models::UserRoleAssignmentRef, pub(crate) scope_id: String, pub(crate) resource_id: String, pub(crate) identity_id: String, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}/{}", + self.client.endpoint(), + self.organization, + self.scope_id, + self.resource_id, + self.identity_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -726,9 +877,7 @@ pub mod roleassignments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -740,28 +889,24 @@ pub mod roleassignments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}/{}", - self.client.endpoint(), - self.organization, - self.scope_id, - self.resource_id, - self.identity_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -806,13 +951,47 @@ pub mod roleassignments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) scope_id: String, pub(crate) resource_id: String, pub(crate) identity_id: String, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}/{}", + self.client.endpoint(), + self.organization, + self.scope_id, + self.resource_id, + self.identity_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -822,9 +1001,7 @@ pub mod roleassignments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -836,27 +1013,24 @@ pub mod roleassignments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/securityroles/scopes/{}/roleassignments/resources/{}/{}", - self.client.endpoint(), - self.organization, - self.scope_id, - self.resource_id, - self.identity_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -932,11 +1106,43 @@ pub mod roledefinitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) scope_id: String, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/securityroles/scopes/{}/roledefinitions", + self.client.endpoint(), + self.organization, + self.scope_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -946,9 +1152,7 @@ pub mod roledefinitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -960,25 +1164,24 @@ pub mod roledefinitions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/securityroles/scopes/{}/roledefinitions", - self.client.endpoint(), - self.organization, - self.scope_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -995,3 +1198,219 @@ pub mod roledefinitions { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn roleassignments_client(&self) -> roleassignments::Client { + roleassignments::Client(self.clone()) + } + pub fn roledefinitions_client(&self) -> roledefinitions::Client { + roledefinitions::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod roleassignments { + use super::super::models; + use super::super::roleassignments::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`change_inheritance`](super::super::roleassignments::Client::change_inheritance) for details of the arguments."] + pub fn change_inheritance( + &self, + scope_id: impl Into, + resource_id: impl Into, + inherit_permissions: bool, + organization: impl Into, + ) -> change_inheritance::RequestBuilder { + change_inheritance::RequestBuilder { + client: self.0.clone(), + scope_id: scope_id.into(), + resource_id: resource_id.into(), + inherit_permissions, + organization: organization.into(), + } + } + #[doc = "Get role assignments for the resource"] + #[doc = ""] + #[doc = "See [`list`](super::super::roleassignments::Client::list) for details of the arguments."] + pub fn list( + &self, + scope_id: impl Into, + resource_id: impl Into, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope_id: scope_id.into(), + resource_id: resource_id.into(), + organization: organization.into(), + } + } + #[doc = "Set role assignments on a resource"] + #[doc = ""] + #[doc = "See [`set_role_assignments`](super::super::roleassignments::Client::set_role_assignments) for details of the arguments."] + pub fn set_role_assignments( + &self, + body: Vec, + scope_id: impl Into, + resource_id: impl Into, + organization: impl Into, + ) -> set_role_assignments::RequestBuilder { + set_role_assignments::RequestBuilder { + client: self.0.clone(), + body, + scope_id: scope_id.into(), + resource_id: resource_id.into(), + organization: organization.into(), + limit_to_caller_identity_domain: None, + } + } + #[doc = "See [`remove_role_assignments`](super::super::roleassignments::Client::remove_role_assignments) for details of the arguments."] + pub fn remove_role_assignments( + &self, + body: Vec, + scope_id: impl Into, + resource_id: impl Into, + organization: impl Into, + ) -> remove_role_assignments::RequestBuilder { + remove_role_assignments::RequestBuilder { + client: self.0.clone(), + body, + scope_id: scope_id.into(), + resource_id: resource_id.into(), + organization: organization.into(), + } + } + #[doc = "Set role assignment on a resource"] + #[doc = ""] + #[doc = "See [`set_role_assignment`](super::super::roleassignments::Client::set_role_assignment) for details of the arguments."] + pub fn set_role_assignment( + &self, + body: impl Into, + scope_id: impl Into, + resource_id: impl Into, + identity_id: impl Into, + organization: impl Into, + ) -> set_role_assignment::RequestBuilder { + set_role_assignment::RequestBuilder { + client: self.0.clone(), + body: body.into(), + scope_id: scope_id.into(), + resource_id: resource_id.into(), + identity_id: identity_id.into(), + organization: organization.into(), + } + } + #[doc = "Remove the role assignment on a resource"] + #[doc = ""] + #[doc = "See [`remove_role_assignment`](super::super::roleassignments::Client::remove_role_assignment) for details of the arguments."] + pub fn remove_role_assignment( + &self, + scope_id: impl Into, + resource_id: impl Into, + identity_id: impl Into, + organization: impl Into, + ) -> remove_role_assignment::RequestBuilder { + remove_role_assignment::RequestBuilder { + client: self.0.clone(), + scope_id: scope_id.into(), + resource_id: resource_id.into(), + identity_id: identity_id.into(), + organization: organization.into(), + } + } + } + } + pub mod roledefinitions { + use super::super::models; + use super::super::roledefinitions::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`list`](super::super::roledefinitions::Client::list) for details of the arguments."] + pub fn list( + &self, + scope_id: impl Into, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + scope_id: scope_id.into(), + organization: organization.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/service_endpoint/mod.rs b/azure_devops_rust_api/src/service_endpoint/mod.rs index ef2550e7..3c39dada 100644 --- a/azure_devops_rust_api/src/service_endpoint/mod.rs +++ b/azure_devops_rust_api/src/service_endpoint/mod.rs @@ -230,13 +230,51 @@ pub mod endpointproxy { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ServiceEndpointRequest, pub(crate) project: String, pub(crate) endpoint_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/endpointproxy?endpointId={}", + self.client.endpoint(), + self.organization, + self.project, + self.endpoint_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -246,9 +284,7 @@ pub mod endpointproxy { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -260,31 +296,24 @@ pub mod endpointproxy { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/endpointproxy?endpointId={}", - self.client.endpoint(), - self.organization, - self.project, - self.endpoint_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -333,12 +362,45 @@ pub mod endpointproxy { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::DataSourceBinding, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/endpointproxy", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -348,9 +410,7 @@ pub mod endpointproxy { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -362,26 +422,24 @@ pub mod endpointproxy { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/endpointproxy", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -621,8 +679,12 @@ pub mod endpoints { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) type_: Option, @@ -633,7 +695,7 @@ pub mod endpoints { pub(crate) include_details: Option, pub(crate) action_filter: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Type of the service endpoints."] pub fn type_(mut self, type_: impl Into) -> Self { self.type_ = Some(type_.into()); @@ -672,6 +734,66 @@ pub mod endpoints { self.action_filter = Some(action_filter.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(type_) = &this.type_ { + req.url_mut().query_pairs_mut().append_pair("type", type_); + } + if let Some(auth_schemes) = &this.auth_schemes { + req.url_mut() + .query_pairs_mut() + .append_pair("authSchemes", auth_schemes); + } + if let Some(endpoint_ids) = &this.endpoint_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("endpointIds", endpoint_ids); + } + if let Some(owner) = &this.owner { + req.url_mut().query_pairs_mut().append_pair("owner", owner); + } + if let Some(include_failed) = &this.include_failed { + req.url_mut() + .query_pairs_mut() + .append_pair("includeFailed", &include_failed.to_string()); + } + if let Some(include_details) = &this.include_details { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDetails", &include_details.to_string()); + } + if let Some(action_filter) = &this.action_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("actionFilter", &action_filter.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/endpoints?", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -680,9 +802,7 @@ pub mod endpoints { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -694,56 +814,24 @@ pub mod endpoints { auth_header, ); } - if let Some(type_) = &this.type_ { - req.url_mut().query_pairs_mut().append_pair("type", type_); - } - if let Some(auth_schemes) = &this.auth_schemes { - req.url_mut() - .query_pairs_mut() - .append_pair("authSchemes", auth_schemes); - } - if let Some(endpoint_ids) = &this.endpoint_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("endpointIds", endpoint_ids); - } - if let Some(owner) = &this.owner { - req.url_mut().query_pairs_mut().append_pair("owner", owner); - } - if let Some(include_failed) = &this.include_failed { - req.url_mut() - .query_pairs_mut() - .append_pair("includeFailed", &include_failed.to_string()); - } - if let Some(include_details) = &this.include_details { - req.url_mut() - .query_pairs_mut() - .append_pair("includeDetails", &include_details.to_string()); - } - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", &action_filter.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/endpoints?", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -793,11 +881,43 @@ pub mod endpoints { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ServiceEndpoint, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -807,9 +927,7 @@ pub mod endpoints { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -821,25 +939,24 @@ pub mod endpoints { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -889,11 +1006,43 @@ pub mod endpoints { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -903,9 +1052,7 @@ pub mod endpoints { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -917,25 +1064,24 @@ pub mod endpoints { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -985,19 +1131,58 @@ pub mod endpoints { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ServiceEndpoint, pub(crate) endpoint_id: String, pub(crate) operation: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "operation type"] pub fn operation(mut self, operation: impl Into) -> Self { self.operation = Some(operation.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/serviceendpoint/endpoints/{}", + self.client.endpoint(), + self.organization, + self.endpoint_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1006,9 +1191,7 @@ pub mod endpoints { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1020,31 +1203,24 @@ pub mod endpoints { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/serviceendpoint/endpoints/{}", - self.client.endpoint(), - self.organization, - self.endpoint_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1089,12 +1265,45 @@ pub mod endpoints { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) endpoint_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/serviceendpoint/endpoints/{}", + self.client.endpoint(), + self.organization, + self.endpoint_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1104,9 +1313,7 @@ pub mod endpoints { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1118,26 +1325,24 @@ pub mod endpoints { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/serviceendpoint/endpoints/{}", - self.client.endpoint(), - self.organization, - self.endpoint_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1185,55 +1390,44 @@ pub mod endpoints { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) endpoint_id: String, pub(crate) project_ids: String, pub(crate) deep: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "delete the spn created by endpoint"] pub fn deep(mut self, deep: bool) -> Self { self.deep = Some(deep); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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::http::headers::AUTHORIZATION, - auth_header, - ); - } - let project_ids = &this.project_ids; - req.url_mut() - .query_pairs_mut() - .append_pair("projectIds", project_ids); - if let Some(deep) = &this.deep { - req.url_mut() - .query_pairs_mut() - .append_pair("deep", &deep.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let project_ids = &this.project_ids; + req.url_mut() + .query_pairs_mut() + .append_pair("projectIds", project_ids); + if let Some(deep) = &this.deep { + req.url_mut() + .query_pairs_mut() + .append_pair("deep", &deep.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -1250,6 +1444,47 @@ pub mod endpoints { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result<()>; type IntoFuture = BoxFuture<'static, azure_core::Result<()>>; @@ -1300,8 +1535,12 @@ pub mod endpoints { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) endpoint_names: String, @@ -1311,7 +1550,7 @@ pub mod endpoints { pub(crate) include_failed: Option, pub(crate) include_details: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Type of the service endpoints."] pub fn type_(mut self, type_: impl Into) -> Self { self.type_ = Some(type_.into()); @@ -1337,6 +1576,60 @@ pub mod endpoints { self.include_details = Some(include_details); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let endpoint_names = &this.endpoint_names; + req.url_mut() + .query_pairs_mut() + .append_pair("endpointNames", endpoint_names); + if let Some(type_) = &this.type_ { + req.url_mut().query_pairs_mut().append_pair("type", type_); + } + if let Some(auth_schemes) = &this.auth_schemes { + req.url_mut() + .query_pairs_mut() + .append_pair("authSchemes", auth_schemes); + } + if let Some(owner) = &this.owner { + req.url_mut().query_pairs_mut().append_pair("owner", owner); + } + if let Some(include_failed) = &this.include_failed { + req.url_mut() + .query_pairs_mut() + .append_pair("includeFailed", &include_failed.to_string()); + } + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/endpoints", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1345,9 +1638,7 @@ pub mod endpoints { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1359,50 +1650,24 @@ pub mod endpoints { auth_header, ); } - let endpoint_names = &this.endpoint_names; - req.url_mut() - .query_pairs_mut() - .append_pair("endpointNames", endpoint_names); - if let Some(type_) = &this.type_ { - req.url_mut().query_pairs_mut().append_pair("type", type_); - } - if let Some(auth_schemes) = &this.auth_schemes { - req.url_mut() - .query_pairs_mut() - .append_pair("authSchemes", auth_schemes); - } - if let Some(owner) = &this.owner { - req.url_mut().query_pairs_mut().append_pair("owner", owner); - } - if let Some(include_failed) = &this.include_failed { - req.url_mut() - .query_pairs_mut() - .append_pair("includeFailed", &include_failed.to_string()); - } - 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/endpoints", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1452,13 +1717,50 @@ pub mod endpoints { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) endpoint_ids: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/endpoints", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1468,9 +1770,7 @@ pub mod endpoints { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1482,30 +1782,24 @@ pub mod endpoints { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/endpoints", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1555,14 +1849,18 @@ pub mod endpoints { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) endpoint_id: String, pub(crate) action_filter: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Action filter for the service connection. It specifies the action which can be performed on the service connection."] pub fn action_filter( mut self, @@ -1571,6 +1869,41 @@ pub mod endpoints { self.action_filter = Some(action_filter.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(action_filter) = &this.action_filter { + req.url_mut() + .query_pairs_mut() + .append_pair("actionFilter", &action_filter.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/endpoints/{}", + self.client.endpoint(), + self.organization, + self.project, + self.endpoint_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1579,9 +1912,7 @@ pub mod endpoints { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1593,31 +1924,24 @@ pub mod endpoints { auth_header, ); } - if let Some(action_filter) = &this.action_filter { - req.url_mut() - .query_pairs_mut() - .append_pair("actionFilter", &action_filter.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/endpoints/{}", - self.client.endpoint(), - self.organization, - self.project, - self.endpoint_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1692,13 +2016,17 @@ pub mod types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) type_: Option, pub(crate) scheme: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Type of service endpoint."] pub fn type_(mut self, type_: impl Into) -> Self { self.type_ = Some(type_.into()); @@ -1709,6 +2037,42 @@ pub mod types { self.scheme = Some(scheme.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(type_) = &this.type_ { + req.url_mut().query_pairs_mut().append_pair("type", type_); + } + if let Some(scheme) = &this.scheme { + req.url_mut() + .query_pairs_mut() + .append_pair("scheme", scheme); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1717,9 +2081,7 @@ pub mod types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1731,32 +2093,24 @@ pub mod types { auth_header, ); } - if let Some(type_) = &this.type_ { - req.url_mut().query_pairs_mut().append_pair("type", type_); - } - if let Some(scheme) = &this.scheme { - req.url_mut() - .query_pairs_mut() - .append_pair("scheme", scheme); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1843,15 +2197,19 @@ pub mod executionhistory { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) endpoint_id: String, pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Number of service endpoint execution records to get."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -1862,6 +2220,46 @@ pub mod executionhistory { self.continuation_token = Some(continuation_token); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", &continuation_token.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/serviceendpoint/{}/executionhistory", + self.client.endpoint(), + self.organization, + self.project, + self.endpoint_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1870,9 +2268,7 @@ pub mod executionhistory { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1884,36 +2280,24 @@ pub mod executionhistory { auth_header, ); } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", &continuation_token.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/serviceendpoint/{}/executionhistory", - self.client.endpoint(), - self.organization, - self.project, - self.endpoint_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1931,3 +2315,344 @@ pub mod executionhistory { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn endpointproxy_client(&self) -> endpointproxy::Client { + endpointproxy::Client(self.clone()) + } + pub fn endpoints_client(&self) -> endpoints::Client { + endpoints::Client(self.clone()) + } + pub fn executionhistory_client(&self) -> executionhistory::Client { + executionhistory::Client(self.clone()) + } + pub fn types_client(&self) -> types::Client { + types::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod endpointproxy { + use super::super::endpointproxy::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Proxy for a GET request defined by a service endpoint."] + #[doc = ""] + #[doc = "See [`execute_service_endpoint_request`](super::super::endpointproxy::Client::execute_service_endpoint_request) for details of the arguments."] + pub fn execute_service_endpoint_request( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + endpoint_id: impl Into, + ) -> execute_service_endpoint_request::RequestBuilder { + execute_service_endpoint_request::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + endpoint_id: endpoint_id.into(), + } + } + #[doc = "Use ExecuteServiceEndpointRequest API Instead"] + #[doc = ""] + #[doc = "See [`query`](super::super::endpointproxy::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod endpoints { + use super::super::endpoints::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the service endpoints."] + #[doc = ""] + #[doc = "See [`get_service_endpoints`](super::super::endpoints::Client::get_service_endpoints) for details of the arguments."] + pub fn get_service_endpoints( + &self, + organization: impl Into, + project: impl Into, + ) -> get_service_endpoints::RequestBuilder { + get_service_endpoints::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + type_: None, + auth_schemes: None, + endpoint_ids: None, + owner: None, + include_failed: None, + include_details: None, + action_filter: None, + } + } + #[doc = "Creates a new service endpoint"] + #[doc = ""] + #[doc = "See [`create`](super::super::endpoints::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Update the service endpoints."] + #[doc = ""] + #[doc = "See [`update_service_endpoints`](super::super::endpoints::Client::update_service_endpoints) for details of the arguments."] + pub fn update_service_endpoints( + &self, + organization: impl Into, + body: Vec, + ) -> update_service_endpoints::RequestBuilder { + update_service_endpoints::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + } + } + #[doc = "Update the service endpoint"] + #[doc = ""] + #[doc = "See [`update_service_endpoint`](super::super::endpoints::Client::update_service_endpoint) for details of the arguments."] + pub fn update_service_endpoint( + &self, + organization: impl Into, + body: impl Into, + endpoint_id: impl Into, + ) -> update_service_endpoint::RequestBuilder { + update_service_endpoint::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + endpoint_id: endpoint_id.into(), + operation: None, + } + } + #[doc = "Share service endpoint across projects"] + #[doc = ""] + #[doc = "See [`share_service_endpoint`](super::super::endpoints::Client::share_service_endpoint) for details of the arguments."] + pub fn share_service_endpoint( + &self, + organization: impl Into, + body: Vec, + endpoint_id: impl Into, + ) -> share_service_endpoint::RequestBuilder { + share_service_endpoint::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + endpoint_id: endpoint_id.into(), + } + } + #[doc = "Delete a service endpoint"] + #[doc = ""] + #[doc = "See [`delete`](super::super::endpoints::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + endpoint_id: impl Into, + project_ids: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + endpoint_id: endpoint_id.into(), + project_ids: project_ids.into(), + deep: None, + } + } + #[doc = "Get the service endpoints by name."] + #[doc = ""] + #[doc = "See [`get_service_endpoints_by_names`](super::super::endpoints::Client::get_service_endpoints_by_names) for details of the arguments."] + pub fn get_service_endpoints_by_names( + &self, + organization: impl Into, + project: impl Into, + endpoint_names: impl Into, + ) -> get_service_endpoints_by_names::RequestBuilder { + get_service_endpoints_by_names::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + endpoint_names: endpoint_names.into(), + type_: None, + auth_schemes: None, + owner: None, + include_failed: None, + include_details: None, + } + } + #[doc = "Gets the service endpoints and patch new authorization parameters"] + #[doc = ""] + #[doc = "See [`get_service_endpoints_with_refreshed_authentication`](super::super::endpoints::Client::get_service_endpoints_with_refreshed_authentication) for details of the arguments."] + pub fn get_service_endpoints_with_refreshed_authentication( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + endpoint_ids: impl Into, + ) -> get_service_endpoints_with_refreshed_authentication::RequestBuilder + { + get_service_endpoints_with_refreshed_authentication::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + endpoint_ids: endpoint_ids.into(), + } + } + #[doc = "Get the service endpoint details."] + #[doc = ""] + #[doc = "See [`get`](super::super::endpoints::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + endpoint_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + endpoint_id: endpoint_id.into(), + action_filter: None, + } + } + } + } + pub mod types { + use super::super::models; + use super::super::types::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get service endpoint types."] + #[doc = ""] + #[doc = "See [`list`](super::super::types::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + type_: None, + scheme: None, + } + } + } + } + pub mod executionhistory { + use super::super::executionhistory::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get service endpoint execution records."] + #[doc = ""] + #[doc = "See [`list`](super::super::executionhistory::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + endpoint_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + endpoint_id: endpoint_id.into(), + top: None, + continuation_token: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/status/mod.rs b/azure_devops_rust_api/src/status/mod.rs index 86f2f3a9..b5305429 100644 --- a/azure_devops_rust_api/src/status/mod.rs +++ b/azure_devops_rust_api/src/status/mod.rs @@ -185,12 +185,16 @@ pub mod health { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) services: Option, pub(crate) geographies: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A comma-separated list of services for which to get status information for. Supported values: Artifacts, Boards, Core services, Other services, Pipelines, Repos, Test Plans."] pub fn services(mut self, services: impl Into) -> Self { self.services = Some(services.into()); @@ -201,6 +205,43 @@ pub mod health { self.geographies = Some(geographies.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(services) = &this.services { + req.url_mut() + .query_pairs_mut() + .append_pair("services", services); + } + if let Some(geographies) = &this.geographies { + req.url_mut() + .query_pairs_mut() + .append_pair("geographies", geographies); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -209,9 +250,7 @@ pub mod health { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -223,33 +262,24 @@ pub mod health { auth_header, ); } - if let Some(services) = &this.services { - req.url_mut() - .query_pairs_mut() - .append_pair("services", services); - } - if let Some(geographies) = &this.geographies { - req.url_mut() - .query_pairs_mut() - .append_pair("geographies", geographies); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -266,3 +296,102 @@ pub mod health { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn health_client(&self) -> health::Client { + health::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod health { + use super::super::health::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Queries status information for the service all-up, or scoped to a particular service and/or geography"] + #[doc = ""] + #[doc = "See [`get`](super::super::health::Client::get) for details of the arguments."] + pub fn get(&self) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + services: None, + geographies: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/symbol/mod.rs b/azure_devops_rust_api/src/symbol/mod.rs index e81b0b56..08f548b8 100644 --- a/azure_devops_rust_api/src/symbol/mod.rs +++ b/azure_devops_rust_api/src/symbol/mod.rs @@ -353,13 +353,55 @@ pub mod requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::DebugEntryCreateBatch, pub(crate) request_name: String, pub(crate) collection: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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); + let collection = &this.collection; + req.url_mut() + .query_pairs_mut() + .append_pair("collection", collection); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/symbol/requests?requestName={}&collection={}", + self.client.endpoint(), + self.organization, + self.request_name, + self.collection + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -369,9 +411,7 @@ pub mod requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -383,35 +423,24 @@ pub mod requests { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/symbol/requests?requestName={}&collection={}", - self.client.endpoint(), - self.organization, - self.request_name, - self.collection - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -461,11 +490,46 @@ pub mod requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) request_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let request_name = &this.request_name; + req.url_mut() + .query_pairs_mut() + .append_pair("requestName", request_name); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -475,9 +539,7 @@ pub mod requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -489,28 +551,24 @@ pub mod requests { auth_header, ); } - let request_name = &this.request_name; - req.url_mut() - .query_pairs_mut() - .append_pair("requestName", request_name); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -560,11 +618,43 @@ pub mod requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Request, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -574,9 +664,7 @@ pub mod requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -588,25 +676,24 @@ pub mod requests { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -656,12 +743,48 @@ pub mod requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Request, pub(crate) request_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -671,9 +794,7 @@ pub mod requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -685,29 +806,24 @@ pub mod requests { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -752,18 +868,59 @@ pub mod requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) request_name: String, pub(crate) synchronous: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If true, delete all the debug entries under this request synchronously in the current session. If false, the deletion will be postponed to a later point and be executed automatically by the system."] pub fn synchronous(mut self, synchronous: bool) -> Self { self.synchronous = Some(synchronous); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let request_name = &this.request_name; + req.url_mut() + .query_pairs_mut() + .append_pair("requestName", request_name); + if let Some(synchronous) = &this.synchronous { + req.url_mut() + .query_pairs_mut() + .append_pair("synchronous", &synchronous.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -772,9 +929,7 @@ pub mod requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -786,33 +941,24 @@ pub mod requests { auth_header, ); } - let request_name = &this.request_name; - req.url_mut() - .query_pairs_mut() - .append_pair("requestName", request_name); - if let Some(synchronous) = &this.synchronous { - req.url_mut() - .query_pairs_mut() - .append_pair("synchronous", &synchronous.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -865,11 +1011,43 @@ pub mod requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) request_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/symbol/requests/{}", + self.client.endpoint(), + self.organization, + self.request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -879,9 +1057,7 @@ pub mod requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -893,25 +1069,24 @@ pub mod requests { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/symbol/requests/{}", - self.client.endpoint(), - self.organization, - self.request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -961,13 +1136,50 @@ pub mod requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::DebugEntryCreateBatch, pub(crate) request_id: String, pub(crate) collection: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/symbol/requests/{}", + self.client.endpoint(), + self.organization, + self.request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -977,9 +1189,7 @@ pub mod requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -991,30 +1201,24 @@ pub mod requests { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/symbol/requests/{}", - self.client.endpoint(), - self.organization, - self.request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1064,12 +1268,45 @@ pub mod requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Request, pub(crate) request_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/symbol/requests/{}", + self.client.endpoint(), + self.organization, + self.request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1079,9 +1316,7 @@ pub mod requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1093,26 +1328,24 @@ pub mod requests { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/symbol/requests/{}", - self.client.endpoint(), - self.organization, - self.request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1157,18 +1390,56 @@ pub mod requests { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) request_id: String, pub(crate) synchronous: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If true, delete all the debug entries under this request synchronously in the current session. If false, the deletion will be postponed to a later point and be executed automatically by the system."] pub fn synchronous(mut self, synchronous: bool) -> Self { self.synchronous = Some(synchronous); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + if let Some(synchronous) = &this.synchronous { + req.url_mut() + .query_pairs_mut() + .append_pair("synchronous", &synchronous.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/symbol/requests/{}", + self.client.endpoint(), + self.organization, + self.request_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1177,9 +1448,7 @@ pub mod requests { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1191,30 +1460,24 @@ pub mod requests { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/symbol/requests/{}", - self.client.endpoint(), - self.organization, - self.request_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1285,10 +1548,41 @@ pub mod availability { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1298,9 +1592,7 @@ pub mod availability { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1312,24 +1604,24 @@ pub mod availability { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1413,10 +1705,41 @@ pub mod client { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Head); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1426,9 +1749,7 @@ pub mod client { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Head); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1440,24 +1761,24 @@ pub mod client { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1508,11 +1829,43 @@ pub mod client { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) client_type: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/symbol/client/{}", + self.client.endpoint(), + self.organization, + self.client_type + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1522,9 +1875,7 @@ pub mod client { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1536,25 +1887,24 @@ pub mod client { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/symbol/client/{}", - self.client.endpoint(), - self.organization, - self.client_type - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1628,12 +1978,45 @@ pub mod contents { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) request_id: String, pub(crate) debug_entry_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/symbol/requests/{}/contents/{}", + self.client.endpoint(), + self.organization, + self.request_id, + self.debug_entry_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1643,9 +2026,7 @@ pub mod contents { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1657,26 +2038,24 @@ pub mod contents { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/symbol/requests/{}/contents/{}", - self.client.endpoint(), - self.organization, - self.request_id, - self.debug_entry_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1750,11 +2129,43 @@ pub mod symsrv { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) debug_entry_client_key: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/symbol/symsrv/{}", + self.client.endpoint(), + self.organization, + self.debug_entry_client_key + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1764,9 +2175,7 @@ pub mod symsrv { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1778,25 +2187,24 @@ pub mod symsrv { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/symbol/symsrv/{}", - self.client.endpoint(), - self.organization, - self.debug_entry_client_key - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1816,3 +2224,342 @@ pub mod symsrv { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn availability_client(&self) -> availability::Client { + availability::Client(self.clone()) + } + pub fn client_client(&self) -> client::Client { + client::Client(self.clone()) + } + pub fn contents_client(&self) -> contents::Client { + contents::Client(self.clone()) + } + pub fn requests_client(&self) -> requests::Client { + requests::Client(self.clone()) + } + pub fn symsrv_client(&self) -> symsrv::Client { + symsrv::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod requests { + use super::super::models; + use super::super::requests::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Create debug entries for a symbol request as specified by its name."] + #[doc = ""] + #[doc = "See [`create_requests_request_name_debug_entries`](super::super::requests::Client::create_requests_request_name_debug_entries) for details of the arguments."] + pub fn create_requests_request_name_debug_entries( + &self, + organization: impl Into, + body: impl Into, + request_name: impl Into, + collection: impl Into, + ) -> create_requests_request_name_debug_entries::RequestBuilder + { + create_requests_request_name_debug_entries::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + request_name: request_name.into(), + collection: collection.into(), + } + } + #[doc = "Get a symbol request by request name."] + #[doc = ""] + #[doc = "See [`get_requests_request_name`](super::super::requests::Client::get_requests_request_name) for details of the arguments."] + pub fn get_requests_request_name( + &self, + organization: impl Into, + request_name: impl Into, + ) -> get_requests_request_name::RequestBuilder { + get_requests_request_name::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + request_name: request_name.into(), + } + } + #[doc = "Create a new symbol request."] + #[doc = ""] + #[doc = "See [`create_requests`](super::super::requests::Client::create_requests) for details of the arguments."] + pub fn create_requests( + &self, + organization: impl Into, + body: impl Into, + ) -> create_requests::RequestBuilder { + create_requests::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Update a symbol request by request name."] + #[doc = ""] + #[doc = "See [`update_requests_request_name`](super::super::requests::Client::update_requests_request_name) for details of the arguments."] + pub fn update_requests_request_name( + &self, + organization: impl Into, + body: impl Into, + request_name: impl Into, + ) -> update_requests_request_name::RequestBuilder { + update_requests_request_name::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + request_name: request_name.into(), + } + } + #[doc = "Delete a symbol request by request name."] + #[doc = ""] + #[doc = "See [`delete_requests_request_name`](super::super::requests::Client::delete_requests_request_name) for details of the arguments."] + pub fn delete_requests_request_name( + &self, + organization: impl Into, + request_name: impl Into, + ) -> delete_requests_request_name::RequestBuilder { + delete_requests_request_name::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + request_name: request_name.into(), + synchronous: None, + } + } + #[doc = "Get a symbol request by request identifier."] + #[doc = ""] + #[doc = "See [`get_requests_request_id`](super::super::requests::Client::get_requests_request_id) for details of the arguments."] + pub fn get_requests_request_id( + &self, + organization: impl Into, + request_id: impl Into, + ) -> get_requests_request_id::RequestBuilder { + get_requests_request_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + request_id: request_id.into(), + } + } + #[doc = "Create debug entries for a symbol request as specified by its identifier."] + #[doc = ""] + #[doc = "See [`create_requests_request_id_debug_entries`](super::super::requests::Client::create_requests_request_id_debug_entries) for details of the arguments."] + pub fn create_requests_request_id_debug_entries( + &self, + organization: impl Into, + body: impl Into, + request_id: impl Into, + collection: impl Into, + ) -> create_requests_request_id_debug_entries::RequestBuilder + { + create_requests_request_id_debug_entries::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + request_id: request_id.into(), + collection: collection.into(), + } + } + #[doc = "Update a symbol request by request identifier."] + #[doc = ""] + #[doc = "See [`update_requests_request_id`](super::super::requests::Client::update_requests_request_id) for details of the arguments."] + pub fn update_requests_request_id( + &self, + organization: impl Into, + body: impl Into, + request_id: impl Into, + ) -> update_requests_request_id::RequestBuilder { + update_requests_request_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + request_id: request_id.into(), + } + } + #[doc = "Delete a symbol request by request identifier."] + #[doc = ""] + #[doc = "See [`delete_requests_request_id`](super::super::requests::Client::delete_requests_request_id) for details of the arguments."] + pub fn delete_requests_request_id( + &self, + organization: impl Into, + request_id: impl Into, + ) -> delete_requests_request_id::RequestBuilder { + delete_requests_request_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + request_id: request_id.into(), + synchronous: None, + } + } + } + } + pub mod availability { + use super::super::availability::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Check the availability of symbol service. This includes checking for feature flag, and possibly license in future. Note this is NOT an anonymous endpoint, and the caller will be redirected to authentication before hitting it."] + #[doc = ""] + #[doc = "See [`check_availability`](super::super::availability::Client::check_availability) for details of the arguments."] + pub fn check_availability( + &self, + organization: impl Into, + ) -> check_availability::RequestBuilder { + check_availability::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + } + } + pub mod client { + use super::super::client::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get client version information."] + #[doc = ""] + #[doc = "See [`head_client`](super::super::client::Client::head_client) for details of the arguments."] + pub fn head_client( + &self, + organization: impl Into, + ) -> head_client::RequestBuilder { + head_client::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Get the client package."] + #[doc = ""] + #[doc = "See [`get`](super::super::client::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + client_type: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + client_type: client_type.into(), + } + } + } + } + pub mod contents { + use super::super::contents::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a stitched debug entry for a symbol request as specified by symbol request identifier and debug entry identifier."] + #[doc = ""] + #[doc = "See [`get`](super::super::contents::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + request_id: impl Into, + debug_entry_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + request_id: request_id.into(), + debug_entry_id: debug_entry_id.into(), + } + } + } + } + pub mod symsrv { + use super::super::models; + use super::super::symsrv::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Given a client key, returns the best matched debug entry."] + #[doc = ""] + #[doc = "See [`get`](super::super::symsrv::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + debug_entry_client_key: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + debug_entry_client_key: debug_entry_client_key.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/test/mod.rs b/azure_devops_rust_api/src/test/mod.rs index bdddad6e..6bdcb57e 100644 --- a/azure_devops_rust_api/src/test/mod.rs +++ b/azure_devops_rust_api/src/test/mod.rs @@ -366,8 +366,12 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) min_last_updated_date: time::OffsetDateTime, @@ -387,7 +391,7 @@ pub mod runs { pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Current state of the Runs to be queried."] pub fn state(mut self, state: impl Into) -> Self { self.state = Some(state.into()); @@ -461,6 +465,119 @@ pub mod runs { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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", &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", &formatted_date_time); + if let Some(state) = &this.state { + req.url_mut() + .query_pairs_mut() + .append_pair("state", &state.to_string()); + } + if let Some(plan_ids) = &this.plan_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("planIds", plan_ids); + } + if let Some(is_automated) = &this.is_automated { + req.url_mut() + .query_pairs_mut() + .append_pair("isAutomated", &is_automated.to_string()); + } + if let Some(publish_context) = &this.publish_context { + req.url_mut() + .query_pairs_mut() + .append_pair("publishContext", &publish_context.to_string()); + } + if let Some(build_ids) = &this.build_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("buildIds", build_ids); + } + if let Some(build_def_ids) = &this.build_def_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("buildDefIds", build_def_ids); + } + if let Some(branch_name) = &this.branch_name { + req.url_mut() + .query_pairs_mut() + .append_pair("branchName", branch_name); + } + if let Some(release_ids) = &this.release_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseIds", release_ids); + } + if let Some(release_def_ids) = &this.release_def_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseDefIds", release_def_ids); + } + if let Some(release_env_ids) = &this.release_env_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseEnvIds", release_env_ids); + } + if let Some(release_env_def_ids) = &this.release_env_def_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseEnvDefIds", release_env_def_ids); + } + if let Some(run_title) = &this.run_title { + req.url_mut() + .query_pairs_mut() + .append_pair("runTitle", run_title); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs?minLastUpdatedDate={}&maxLastUpdatedDate={}", + self.client.endpoint(), + self.organization, + self.project, + self.min_last_updated_date, + self.max_last_updated_date + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -469,9 +586,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -483,109 +598,24 @@ pub mod runs { 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", &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", &formatted_date_time); - if let Some(state) = &this.state { - req.url_mut() - .query_pairs_mut() - .append_pair("state", &state.to_string()); - } - if let Some(plan_ids) = &this.plan_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("planIds", plan_ids); - } - if let Some(is_automated) = &this.is_automated { - req.url_mut() - .query_pairs_mut() - .append_pair("isAutomated", &is_automated.to_string()); - } - if let Some(publish_context) = &this.publish_context { - req.url_mut() - .query_pairs_mut() - .append_pair("publishContext", &publish_context.to_string()); - } - if let Some(build_ids) = &this.build_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("buildIds", build_ids); - } - if let Some(build_def_ids) = &this.build_def_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("buildDefIds", build_def_ids); - } - if let Some(branch_name) = &this.branch_name { - req.url_mut() - .query_pairs_mut() - .append_pair("branchName", branch_name); - } - if let Some(release_ids) = &this.release_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("releaseIds", release_ids); - } - if let Some(release_def_ids) = &this.release_def_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("releaseDefIds", release_def_ids); - } - if let Some(release_env_ids) = &this.release_env_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("releaseEnvIds", release_env_ids); - } - if let Some(release_env_def_ids) = &this.release_env_def_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("releaseEnvDefIds", release_env_def_ids); - } - if let Some(run_title) = &this.run_title { - req.url_mut() - .query_pairs_mut() - .append_pair("runTitle", run_title); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs?minLastUpdatedDate={}&maxLastUpdatedDate={}", - self.client.endpoint(), - self.organization, - self.project, - self.min_last_updated_date, - self.max_last_updated_date - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -635,8 +665,12 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_uri: Option, @@ -648,7 +682,7 @@ pub mod runs { pub(crate) skip: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "URI of the build that the runs used."] pub fn build_uri(mut self, build_uri: impl Into) -> Self { self.build_uri = Some(build_uri.into()); @@ -688,6 +722,73 @@ pub mod runs { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(build_uri) = &this.build_uri { + req.url_mut() + .query_pairs_mut() + .append_pair("buildUri", build_uri); + } + if let Some(owner) = &this.owner { + req.url_mut().query_pairs_mut().append_pair("owner", owner); + } + if let Some(tmi_run_id) = &this.tmi_run_id { + req.url_mut() + .query_pairs_mut() + .append_pair("tmiRunId", tmi_run_id); + } + if let Some(plan_id) = &this.plan_id { + req.url_mut() + .query_pairs_mut() + .append_pair("planId", &plan_id.to_string()); + } + if let Some(include_run_details) = &this.include_run_details { + req.url_mut() + .query_pairs_mut() + .append_pair("includeRunDetails", &include_run_details.to_string()); + } + if let Some(automated) = &this.automated { + req.url_mut() + .query_pairs_mut() + .append_pair("automated", &automated.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -696,9 +797,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -710,63 +809,24 @@ pub mod runs { auth_header, ); } - if let Some(build_uri) = &this.build_uri { - req.url_mut() - .query_pairs_mut() - .append_pair("buildUri", build_uri); - } - if let Some(owner) = &this.owner { - req.url_mut().query_pairs_mut().append_pair("owner", owner); - } - if let Some(tmi_run_id) = &this.tmi_run_id { - req.url_mut() - .query_pairs_mut() - .append_pair("tmiRunId", tmi_run_id); - } - if let Some(plan_id) = &this.plan_id { - req.url_mut() - .query_pairs_mut() - .append_pair("planId", &plan_id.to_string()); - } - if let Some(include_run_details) = &this.include_run_details { - req.url_mut() - .query_pairs_mut() - .append_pair("includeRunDetails", &include_run_details.to_string()); - } - if let Some(automated) = &this.automated { - req.url_mut() - .query_pairs_mut() - .append_pair("automated", &automated.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -816,12 +876,45 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::RunCreateModel, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -831,9 +924,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -845,26 +936,24 @@ pub mod runs { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -914,19 +1003,58 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) include_details: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Default value is true. It includes details like run statistics, release, build, test environment, post process state, and more."] pub fn include_details(mut self, include_details: bool) -> Self { self.include_details = Some(include_details); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -935,9 +1063,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -949,31 +1075,24 @@ pub mod runs { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1023,13 +1142,47 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::RunUpdateModel, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1039,9 +1192,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1053,27 +1204,24 @@ pub mod runs { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1118,12 +1266,45 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1133,9 +1314,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1147,26 +1326,24 @@ pub mod runs { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1219,24 +1396,55 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/runs/{}/Statistics", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] pub fn send(self) -> BoxFuture<'static, azure_core::Result> { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1248,26 +1456,24 @@ pub mod runs { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/runs/{}/Statistics", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1543,14 +1749,53 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_case_result_id: i32, pub(crate) test_sub_result_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments?testSubResultId={}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id, + self.test_sub_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1560,9 +1805,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1574,32 +1817,24 @@ pub mod attachments { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments?testSubResultId={}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id, - self.test_sub_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1652,8 +1887,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestAttachmentRequestModel, pub(crate) project: String, @@ -1661,6 +1900,42 @@ pub mod attachments { pub(crate) test_case_result_id: i32, pub(crate) test_sub_result_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments?testSubResultId={}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id, + self.test_sub_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1670,9 +1945,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1684,33 +1957,24 @@ pub mod attachments { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments?testSubResultId={}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id, - self.test_sub_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1759,8 +2023,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -1768,6 +2036,42 @@ pub mod attachments { pub(crate) attachment_id: i32, pub(crate) test_sub_result_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1777,9 +2081,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1791,33 +2093,24 @@ pub mod attachments { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1867,12 +2160,45 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/attachments", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1882,9 +2208,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1896,26 +2220,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/attachments", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1968,13 +2290,47 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestAttachmentRequestModel, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/attachments", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1984,9 +2340,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1998,27 +2352,24 @@ pub mod attachments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/attachments", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2067,13 +2418,47 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) attachment_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/attachments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.attachment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2083,9 +2468,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2097,27 +2480,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/attachments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.attachment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2167,25 +2547,57 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_case_result_id: i32, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2197,27 +2609,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2270,14 +2679,49 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestAttachmentRequestModel, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_case_result_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2287,9 +2731,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2301,28 +2743,24 @@ pub mod attachments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2371,14 +2809,49 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_case_result_id: i32, pub(crate) attachment_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id, + self.attachment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2388,9 +2861,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2402,28 +2873,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/attachments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id, - self.attachment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2527,13 +2994,53 @@ pub mod code_coverage { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) flags: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let build_id = &this.build_id; + req.url_mut() + .query_pairs_mut() + .append_pair("buildId", &build_id.to_string()); + let flags = &this.flags; + req.url_mut() + .query_pairs_mut() + .append_pair("flags", &flags.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/codecoverage", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2543,9 +3050,7 @@ pub mod code_coverage { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2557,33 +3062,24 @@ pub mod code_coverage { auth_header, ); } - let build_id = &this.build_id; - req.url_mut() - .query_pairs_mut() - .append_pair("buildId", &build_id.to_string()); - let flags = &this.flags; - req.url_mut() - .query_pairs_mut() - .append_pair("flags", &flags.to_string()); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/codecoverage", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2633,13 +3129,50 @@ pub mod code_coverage { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) flags: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let flags = &this.flags; + req.url_mut() + .query_pairs_mut() + .append_pair("flags", &flags.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/codecoverage", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2649,9 +3182,7 @@ pub mod code_coverage { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2663,30 +3194,24 @@ pub mod code_coverage { auth_header, ); } - let flags = &this.flags; - req.url_mut() - .query_pairs_mut() - .append_pair("flags", &flags.to_string()); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/codecoverage", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2850,8 +3375,12 @@ pub mod points { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, @@ -2864,7 +3393,7 @@ pub mod points { pub(crate) skip: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Comma-separated list of work item field names."] pub fn wit_fields(mut self, wit_fields: impl Into) -> Self { self.wit_fields = Some(wit_fields.into()); @@ -2900,6 +3429,72 @@ pub mod points { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(wit_fields) = &this.wit_fields { + req.url_mut() + .query_pairs_mut() + .append_pair("witFields", wit_fields); + } + if let Some(configuration_id) = &this.configuration_id { + req.url_mut() + .query_pairs_mut() + .append_pair("configurationId", configuration_id); + } + if let Some(test_case_id) = &this.test_case_id { + req.url_mut() + .query_pairs_mut() + .append_pair("testCaseId", test_case_id); + } + if let Some(test_point_ids) = &this.test_point_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("testPointIds", test_point_ids); + } + if let Some(include_point_details) = &this.include_point_details { + req.url_mut() + .query_pairs_mut() + .append_pair("includePointDetails", &include_point_details.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2908,9 +3503,7 @@ pub mod points { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2922,63 +3515,24 @@ pub mod points { auth_header, ); } - if let Some(wit_fields) = &this.wit_fields { - req.url_mut() - .query_pairs_mut() - .append_pair("witFields", wit_fields); - } - if let Some(configuration_id) = &this.configuration_id { - req.url_mut() - .query_pairs_mut() - .append_pair("configurationId", configuration_id); - } - if let Some(test_case_id) = &this.test_case_id { - req.url_mut() - .query_pairs_mut() - .append_pair("testCaseId", test_case_id); - } - if let Some(test_point_ids) = &this.test_point_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("testPointIds", test_point_ids); - } - if let Some(include_point_details) = &this.include_point_details { - req.url_mut().query_pairs_mut().append_pair( - "includePointDetails", - &include_point_details.to_string(), - ); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3028,8 +3582,12 @@ pub mod points { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, @@ -3037,12 +3595,49 @@ pub mod points { pub(crate) point_ids: i32, pub(crate) wit_fields: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Comma-separated list of work item field names."] pub fn wit_fields(mut self, wit_fields: impl Into) -> Self { self.wit_fields = Some(wit_fields.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(wit_fields) = &this.wit_fields { + req.url_mut() + .query_pairs_mut() + .append_pair("witFields", wit_fields); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points/{}", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id, + self.point_ids + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3051,9 +3646,7 @@ pub mod points { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3065,33 +3658,24 @@ pub mod points { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points/{}", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id, - self.point_ids - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3141,8 +3725,12 @@ pub mod points { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PointUpdateModel, pub(crate) project: String, @@ -3150,6 +3738,38 @@ pub mod points { pub(crate) suite_id: i32, pub(crate) point_ids: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points/{}", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id, + self.point_ids + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3159,9 +3779,7 @@ pub mod points { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3173,29 +3791,24 @@ pub mod points { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/Suites/{}/points/{}", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id, - self.point_ids - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3245,15 +3858,19 @@ pub mod points { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestPointsQuery, pub(crate) project: String, pub(crate) skip: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Number of test points to skip."] pub fn skip(mut self, skip: i32) -> Self { self.skip = Some(skip); @@ -3264,6 +3881,46 @@ pub mod points { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/points", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3272,9 +3929,7 @@ pub mod points { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3286,36 +3941,24 @@ pub mod points { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/points", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3500,13 +4143,47 @@ pub mod test_suites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, pub(crate) suite_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3516,9 +4193,7 @@ pub mod test_suites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3530,27 +4205,24 @@ pub mod test_suites { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3600,14 +4272,49 @@ pub mod test_suites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, pub(crate) suite_id: i32, pub(crate) test_case_ids: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id, + self.test_case_ids + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3617,9 +4324,7 @@ pub mod test_suites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3631,28 +4336,24 @@ pub mod test_suites { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id, - self.test_case_ids - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3702,14 +4403,50 @@ pub mod test_suites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, pub(crate) suite_id: i32, pub(crate) test_case_ids: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id, + self.test_case_ids + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3719,9 +4456,7 @@ pub mod test_suites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3733,29 +4468,24 @@ pub mod test_suites { auth_header, ); } - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id, - self.test_case_ids - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3805,8 +4535,12 @@ pub mod test_suites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::SuiteTestCaseUpdateModel, pub(crate) project: String, @@ -3814,6 +4548,38 @@ pub mod test_suites { pub(crate) suite_id: i32, pub(crate) test_case_ids: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id, + self.test_case_ids + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3823,9 +4589,7 @@ pub mod test_suites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3837,29 +4601,24 @@ pub mod test_suites { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id, - self.test_case_ids - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3904,14 +4663,49 @@ pub mod test_suites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, pub(crate) suite_id: i32, pub(crate) test_case_ids: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id, + self.test_case_ids + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3921,9 +4715,7 @@ pub mod test_suites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3935,28 +4727,24 @@ pub mod test_suites { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Plans/{}/suites/{}/testcases/{}", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id, - self.test_case_ids - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4057,11 +4845,43 @@ pub mod result_retention_settings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/resultretentionsettings", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4071,9 +4891,7 @@ pub mod result_retention_settings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4085,25 +4903,24 @@ pub mod result_retention_settings { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/resultretentionsettings", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4157,12 +4974,45 @@ pub mod result_retention_settings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ResultRetentionSettings, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/resultretentionsettings", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4172,9 +5022,7 @@ pub mod result_retention_settings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4186,26 +5034,24 @@ pub mod result_retention_settings { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/resultretentionsettings", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4285,12 +5131,45 @@ pub mod test_history { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestHistoryQuery, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Results/testhistory", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4300,9 +5179,7 @@ pub mod test_history { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4314,26 +5191,24 @@ pub mod test_history { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Results/testhistory", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4483,8 +5358,12 @@ pub mod results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -4493,7 +5372,7 @@ pub mod results { pub(crate) top: Option, pub(crate) outcomes: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Details to include with test results. Default is None. Other values are Iterations and WorkItems."] pub fn details_to_include( mut self, @@ -4517,6 +5396,56 @@ pub mod results { self.outcomes = Some(outcomes.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(details_to_include) = &this.details_to_include { + req.url_mut() + .query_pairs_mut() + .append_pair("detailsToInclude", &details_to_include.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(outcomes) = &this.outcomes { + req.url_mut() + .query_pairs_mut() + .append_pair("outcomes", outcomes); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/results", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4525,9 +5454,7 @@ pub mod results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4539,46 +5466,24 @@ pub mod results { auth_header, ); } - if let Some(details_to_include) = &this.details_to_include { - req.url_mut() - .query_pairs_mut() - .append_pair("detailsToInclude", &details_to_include.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(outcomes) = &this.outcomes { - req.url_mut() - .query_pairs_mut() - .append_pair("outcomes", outcomes); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/results", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4628,13 +5533,47 @@ pub mod results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/results", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4644,9 +5583,7 @@ pub mod results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4658,27 +5595,24 @@ pub mod results { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/results", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4728,13 +5662,47 @@ pub mod results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/results", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4744,9 +5712,7 @@ pub mod results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4758,27 +5724,24 @@ pub mod results { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/results", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4828,15 +5791,19 @@ pub mod results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_case_result_id: i32, pub(crate) details_to_include: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Details to include with test results. Default is None. Other values are Iterations, WorkItems and SubResults."] pub fn details_to_include( mut self, @@ -4845,6 +5812,42 @@ pub mod results { self.details_to_include = Some(details_to_include.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(details_to_include) = &this.details_to_include { + req.url_mut() + .query_pairs_mut() + .append_pair("detailsToInclude", &details_to_include.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/results/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4853,9 +5856,7 @@ pub mod results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4867,32 +5868,24 @@ pub mod results { auth_header, ); } - if let Some(details_to_include) = &this.details_to_include { - req.url_mut() - .query_pairs_mut() - .append_pair("detailsToInclude", &details_to_include.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/results/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5004,20 +5997,60 @@ pub mod iterations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_case_result_id: i32, pub(crate) include_action_results: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration."] pub fn include_action_results(mut self, include_action_results: bool) -> Self { self.include_action_results = Some(include_action_results); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_action_results) = &this.include_action_results { + req.url_mut() + .query_pairs_mut() + .append_pair("includeActionResults", &include_action_results.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/iterations", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5026,9 +6059,7 @@ pub mod iterations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5040,33 +6071,24 @@ pub mod iterations { auth_header, ); } - if let Some(include_action_results) = &this.include_action_results { - req.url_mut().query_pairs_mut().append_pair( - "includeActionResults", - &include_action_results.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/iterations", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5120,8 +6142,12 @@ pub mod iterations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -5129,12 +6155,49 @@ pub mod iterations { pub(crate) iteration_id: i32, pub(crate) include_action_results: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration."] pub fn include_action_results(mut self, include_action_results: bool) -> Self { self.include_action_results = Some(include_action_results); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_action_results) = &this.include_action_results { + req.url_mut() + .query_pairs_mut() + .append_pair("includeActionResults", &include_action_results.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/Runs/{}/Results/{}/iterations/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5143,9 +6206,7 @@ pub mod iterations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5157,34 +6218,24 @@ pub mod iterations { auth_header, ); } - if let Some(include_action_results) = &this.include_action_results { - req.url_mut().query_pairs_mut().append_pair( - "includeActionResults", - &include_action_results.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/Runs/{}/Results/{}/iterations/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5259,12 +6310,45 @@ pub mod test_cases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) test_case_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/test/testcases/{}", + self.client.endpoint(), + self.organization, + self.project, + self.test_case_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5274,9 +6358,7 @@ pub mod test_cases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5288,26 +6370,24 @@ pub mod test_cases { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/test/testcases/{}", - self.client.endpoint(), - self.organization, - self.project, - self.test_case_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5438,8 +6518,12 @@ pub mod session { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, @@ -5449,7 +6533,7 @@ pub mod session { pub(crate) source: Option, pub(crate) include_only_completed_sessions: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Period in days from now, for which test sessions are fetched."] pub fn period(mut self, period: i32) -> Self { self.period = Some(period); @@ -5478,6 +6562,63 @@ pub mod session { self.include_only_completed_sessions = Some(include_only_completed_sessions); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(period) = &this.period { + req.url_mut() + .query_pairs_mut() + .append_pair("period", &period.to_string()); + } + if let Some(all_sessions) = &this.all_sessions { + req.url_mut() + .query_pairs_mut() + .append_pair("allSessions", &all_sessions.to_string()); + } + if let Some(include_all_properties) = &this.include_all_properties { + req.url_mut() + .query_pairs_mut() + .append_pair("includeAllProperties", &include_all_properties.to_string()); + } + if let Some(source) = &this.source { + req.url_mut() + .query_pairs_mut() + .append_pair("source", &source.to_string()); + } + if let Some(include_only_completed_sessions) = &this.include_only_completed_sessions + { + req.url_mut().query_pairs_mut().append_pair( + "includeOnlyCompletedSessions", + &include_only_completed_sessions.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/test/session", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5486,9 +6627,7 @@ pub mod session { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5500,55 +6639,24 @@ pub mod session { auth_header, ); } - if let Some(period) = &this.period { - req.url_mut() - .query_pairs_mut() - .append_pair("period", &period.to_string()); - } - if let Some(all_sessions) = &this.all_sessions { - req.url_mut() - .query_pairs_mut() - .append_pair("allSessions", &all_sessions.to_string()); - } - if let Some(include_all_properties) = &this.include_all_properties { - req.url_mut().query_pairs_mut().append_pair( - "includeAllProperties", - &include_all_properties.to_string(), - ); - } - if let Some(source) = &this.source { - req.url_mut() - .query_pairs_mut() - .append_pair("source", &source.to_string()); - } - if let Some(include_only_completed_sessions) = - &this.include_only_completed_sessions - { - req.url_mut().query_pairs_mut().append_pair( - "includeOnlyCompletedSessions", - &include_only_completed_sessions.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/test/session", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5598,13 +6706,47 @@ pub mod session { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestSession, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/test/session", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5614,9 +6756,7 @@ pub mod session { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5628,27 +6768,24 @@ pub mod session { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/test/session", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5698,13 +6835,47 @@ pub mod session { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestSession, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/test/session", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5714,9 +6885,7 @@ pub mod session { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5728,27 +6897,24 @@ pub mod session { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/test/session", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5765,3 +6931,959 @@ pub mod session { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn attachments_client(&self) -> attachments::Client { + attachments::Client(self.clone()) + } + pub fn code_coverage_client(&self) -> code_coverage::Client { + code_coverage::Client(self.clone()) + } + pub fn iterations_client(&self) -> iterations::Client { + iterations::Client(self.clone()) + } + pub fn points_client(&self) -> points::Client { + points::Client(self.clone()) + } + pub fn result_retention_settings_client(&self) -> result_retention_settings::Client { + result_retention_settings::Client(self.clone()) + } + pub fn results_client(&self) -> results::Client { + results::Client(self.clone()) + } + pub fn runs_client(&self) -> runs::Client { + runs::Client(self.clone()) + } + pub fn session_client(&self) -> session::Client { + session::Client(self.clone()) + } + pub fn test_cases_client(&self) -> test_cases::Client { + test_cases::Client(self.clone()) + } + pub fn test_history_client(&self) -> test_history::Client { + test_history::Client(self.clone()) + } + pub fn test_suites_client(&self) -> test_suites::Client { + test_suites::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod runs { + use super::super::models; + use super::super::runs::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate."] + #[doc = ""] + #[doc = "See [`query`](super::super::runs::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + project: impl Into, + min_last_updated_date: impl Into, + max_last_updated_date: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + min_last_updated_date: min_last_updated_date.into(), + max_last_updated_date: max_last_updated_date.into(), + state: None, + plan_ids: None, + is_automated: None, + publish_context: None, + build_ids: None, + build_def_ids: None, + branch_name: None, + release_ids: None, + release_def_ids: None, + release_env_ids: None, + release_env_def_ids: None, + run_title: None, + top: None, + continuation_token: None, + } + } + #[doc = "Get a list of test runs."] + #[doc = ""] + #[doc = "See [`list`](super::super::runs::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_uri: None, + owner: None, + tmi_run_id: None, + plan_id: None, + include_run_details: None, + automated: None, + skip: None, + top: None, + } + } + #[doc = "Create new test run."] + #[doc = ""] + #[doc = "See [`create`](super::super::runs::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get a test run by its ID."] + #[doc = ""] + #[doc = "See [`get_test_run_by_id`](super::super::runs::Client::get_test_run_by_id) for details of the arguments."] + pub fn get_test_run_by_id( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + ) -> get_test_run_by_id::RequestBuilder { + get_test_run_by_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + include_details: None, + } + } + #[doc = "Update test run by its ID."] + #[doc = ""] + #[doc = "See [`update`](super::super::runs::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + run_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + run_id, + } + } + #[doc = "Delete a test run by its ID."] + #[doc = ""] + #[doc = "See [`delete`](super::super::runs::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + } + } + #[doc = "Get test run statistics , used when we want to get summary of a run by outcome."] + #[doc = ""] + #[doc = "See [`get_test_run_statistics`](super::super::runs::Client::get_test_run_statistics) for details of the arguments."] + pub fn get_test_run_statistics( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + ) -> get_test_run_statistics::RequestBuilder { + get_test_run_statistics::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + } + } + } + } + pub mod attachments { + use super::super::attachments::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get list of test sub result attachments"] + #[doc = ""] + #[doc = "See [`get_test_sub_result_attachments`](super::super::attachments::Client::get_test_sub_result_attachments) for details of the arguments."] + pub fn get_test_sub_result_attachments( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + test_sub_result_id: i32, + ) -> get_test_sub_result_attachments::RequestBuilder { + get_test_sub_result_attachments::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + test_sub_result_id, + } + } + #[doc = "Attach a file to a test result"] + #[doc = ""] + #[doc = "See [`create_test_sub_result_attachment`](super::super::attachments::Client::create_test_sub_result_attachment) for details of the arguments."] + pub fn create_test_sub_result_attachment( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + test_sub_result_id: i32, + ) -> create_test_sub_result_attachment::RequestBuilder { + create_test_sub_result_attachment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + run_id, + test_case_result_id, + test_sub_result_id, + } + } + #[doc = "Download a test sub result attachment"] + #[doc = ""] + #[doc = "See [`get_test_sub_result_attachment_zip`](super::super::attachments::Client::get_test_sub_result_attachment_zip) for details of the arguments."] + pub fn get_test_sub_result_attachment_zip( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + attachment_id: i32, + test_sub_result_id: i32, + ) -> get_test_sub_result_attachment_zip::RequestBuilder { + get_test_sub_result_attachment_zip::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + attachment_id, + test_sub_result_id, + } + } + #[doc = "Get list of test run attachments reference."] + #[doc = ""] + #[doc = "See [`get_test_run_attachments`](super::super::attachments::Client::get_test_run_attachments) for details of the arguments."] + pub fn get_test_run_attachments( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + ) -> get_test_run_attachments::RequestBuilder { + get_test_run_attachments::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + } + } + #[doc = "Attach a file to a test run."] + #[doc = ""] + #[doc = "See [`create_test_run_attachment`](super::super::attachments::Client::create_test_run_attachment) for details of the arguments."] + pub fn create_test_run_attachment( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + run_id: i32, + ) -> create_test_run_attachment::RequestBuilder { + create_test_run_attachment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + run_id, + } + } + #[doc = "Download a test run attachment by its ID."] + #[doc = ""] + #[doc = "See [`get_test_run_attachment_zip`](super::super::attachments::Client::get_test_run_attachment_zip) for details of the arguments."] + pub fn get_test_run_attachment_zip( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + attachment_id: i32, + ) -> get_test_run_attachment_zip::RequestBuilder { + get_test_run_attachment_zip::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + attachment_id, + } + } + #[doc = "Get list of test result attachments reference."] + #[doc = ""] + #[doc = "See [`get_test_result_attachments`](super::super::attachments::Client::get_test_result_attachments) for details of the arguments."] + pub fn get_test_result_attachments( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + ) -> get_test_result_attachments::RequestBuilder { + get_test_result_attachments::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + } + } + #[doc = "Attach a file to a test result."] + #[doc = ""] + #[doc = "See [`create_test_result_attachment`](super::super::attachments::Client::create_test_result_attachment) for details of the arguments."] + pub fn create_test_result_attachment( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + ) -> create_test_result_attachment::RequestBuilder { + create_test_result_attachment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + run_id, + test_case_result_id, + } + } + #[doc = "Download a test result attachment by its ID."] + #[doc = ""] + #[doc = "See [`get_test_result_attachment_zip`](super::super::attachments::Client::get_test_result_attachment_zip) for details of the arguments."] + pub fn get_test_result_attachment_zip( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + attachment_id: i32, + ) -> get_test_result_attachment_zip::RequestBuilder { + get_test_result_attachment_zip::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + attachment_id, + } + } + } + } + pub mod code_coverage { + use super::super::code_coverage::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get code coverage data for a build."] + #[doc = ""] + #[doc = "See [`get_build_code_coverage`](super::super::code_coverage::Client::get_build_code_coverage) for details of the arguments."] + pub fn get_build_code_coverage( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + flags: i32, + ) -> get_build_code_coverage::RequestBuilder { + get_build_code_coverage::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + flags, + } + } + #[doc = "Get code coverage data for a test run"] + #[doc = ""] + #[doc = "See [`get_test_run_code_coverage`](super::super::code_coverage::Client::get_test_run_code_coverage) for details of the arguments."] + pub fn get_test_run_code_coverage( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + flags: i32, + ) -> get_test_run_code_coverage::RequestBuilder { + get_test_run_code_coverage::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + flags, + } + } + } + } + pub mod points { + use super::super::models; + use super::super::points::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of test points."] + #[doc = ""] + #[doc = "See [`list`](super::super::points::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + wit_fields: None, + configuration_id: None, + test_case_id: None, + test_point_ids: None, + include_point_details: None, + skip: None, + top: None, + } + } + #[doc = "Get a test point."] + #[doc = ""] + #[doc = "See [`get_point`](super::super::points::Client::get_point) for details of the arguments."] + pub fn get_point( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + point_ids: i32, + ) -> get_point::RequestBuilder { + get_point::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + point_ids, + wit_fields: None, + } + } + #[doc = "Update test points."] + #[doc = ""] + #[doc = "See [`update`](super::super::points::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + point_ids: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + plan_id, + suite_id, + point_ids: point_ids.into(), + } + } + #[doc = "Get test points using query."] + #[doc = ""] + #[doc = "See [`get_points_by_query`](super::super::points::Client::get_points_by_query) for details of the arguments."] + pub fn get_points_by_query( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> get_points_by_query::RequestBuilder { + get_points_by_query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + skip: None, + top: None, + } + } + } + } + pub mod test_suites { + use super::super::models; + use super::super::test_suites::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all test cases in a suite."] + #[doc = ""] + #[doc = "See [`list`](super::super::test_suites::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + } + } + #[doc = "Get a specific test case in a test suite with test case id."] + #[doc = ""] + #[doc = "See [`get`](super::super::test_suites::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + test_case_ids: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + test_case_ids, + } + } + #[doc = "Add test cases to suite."] + #[doc = ""] + #[doc = "See [`add`](super::super::test_suites::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + test_case_ids: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + test_case_ids: test_case_ids.into(), + } + } + #[doc = "Updates the properties of the test case association in a suite."] + #[doc = ""] + #[doc = "See [`update`](super::super::test_suites::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + test_case_ids: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + plan_id, + suite_id, + test_case_ids: test_case_ids.into(), + } + } + #[doc = "The test points associated with the test cases are removed from the test suite. The test case work item is not deleted from the system. See test cases resource to delete a test case permanently."] + #[doc = ""] + #[doc = "See [`remove_test_cases_from_suite_url`](super::super::test_suites::Client::remove_test_cases_from_suite_url) for details of the arguments."] + pub fn remove_test_cases_from_suite_url( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + test_case_ids: impl Into, + ) -> remove_test_cases_from_suite_url::RequestBuilder { + remove_test_cases_from_suite_url::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + test_case_ids: test_case_ids.into(), + } + } + } + } + pub mod result_retention_settings { + use super::super::models; + use super::super::result_retention_settings::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get test result retention settings"] + #[doc = ""] + #[doc = "See [`get`](super::super::result_retention_settings::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Update test result retention settings"] + #[doc = ""] + #[doc = "See [`update`](super::super::result_retention_settings::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod test_history { + use super::super::models; + use super::super::test_history::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get history of a test method using TestHistoryQuery"] + #[doc = ""] + #[doc = "See [`query`](super::super::test_history::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod results { + use super::super::models; + use super::super::results::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get test results for a test run."] + #[doc = ""] + #[doc = "See [`list`](super::super::results::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + details_to_include: None, + skip: None, + top: None, + outcomes: None, + } + } + #[doc = "Add test results to a test run."] + #[doc = ""] + #[doc = "See [`add`](super::super::results::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + run_id: i32, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + run_id, + } + } + #[doc = "Update test results in a test run."] + #[doc = ""] + #[doc = "See [`update`](super::super::results::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + run_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + run_id, + } + } + #[doc = "Get a test result for a test run."] + #[doc = ""] + #[doc = "See [`get`](super::super::results::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + details_to_include: None, + } + } + } + } + pub mod iterations { + use super::super::iterations::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get iterations for a result"] + #[doc = ""] + #[doc = "See [`list`](super::super::iterations::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + include_action_results: None, + } + } + #[doc = "Get iteration for a result"] + #[doc = ""] + #[doc = "See [`get`](super::super::iterations::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + iteration_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + iteration_id, + include_action_results: None, + } + } + } + } + pub mod test_cases { + use super::super::models; + use super::super::test_cases::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Delete a test case."] + #[doc = ""] + #[doc = "See [`delete`](super::super::test_cases::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + test_case_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_case_id, + } + } + } + } + pub mod session { + use super::super::models; + use super::super::session::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of test sessions"] + #[doc = ""] + #[doc = "See [`list`](super::super::session::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + period: None, + all_sessions: None, + include_all_properties: None, + source: None, + include_only_completed_sessions: None, + } + } + #[doc = "Create a test session"] + #[doc = ""] + #[doc = "See [`create`](super::super::session::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "Update a test session"] + #[doc = ""] + #[doc = "See [`update`](super::super::session::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/test_plan/mod.rs b/azure_devops_rust_api/src/test_plan/mod.rs index 152a7f8e..f361a5d2 100644 --- a/azure_devops_rust_api/src/test_plan/mod.rs +++ b/azure_devops_rust_api/src/test_plan/mod.rs @@ -359,14 +359,53 @@ pub mod suite_test_case { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, pub(crate) suite_id: i32, pub(crate) test_case_ids: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase?testCaseIds={}", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id, + self.test_case_ids + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -376,9 +415,7 @@ pub mod suite_test_case { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -390,32 +427,24 @@ pub mod suite_test_case { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase?testCaseIds={}", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id, - self.test_case_ids - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -468,8 +497,12 @@ pub mod suite_test_case { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, @@ -483,7 +516,7 @@ pub mod suite_test_case { pub(crate) exclude_flags: Option, pub(crate) is_recursive: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Test Case Ids to be fetched."] pub fn test_ids(mut self, test_ids: impl Into) -> Self { self.test_ids = Some(test_ids.into()); @@ -523,6 +556,77 @@ pub mod suite_test_case { self.is_recursive = Some(is_recursive); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(test_ids) = &this.test_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("testIds", test_ids); + } + if let Some(configuration_ids) = &this.configuration_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("configurationIds", configuration_ids); + } + if let Some(wit_fields) = &this.wit_fields { + req.url_mut() + .query_pairs_mut() + .append_pair("witFields", wit_fields); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(return_identity_ref) = &this.return_identity_ref { + req.url_mut() + .query_pairs_mut() + .append_pair("returnIdentityRef", &return_identity_ref.to_string()); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("expand", &expand.to_string()); + } + if let Some(exclude_flags) = &this.exclude_flags { + req.url_mut() + .query_pairs_mut() + .append_pair("excludeFlags", &exclude_flags.to_string()); + } + if let Some(is_recursive) = &this.is_recursive { + req.url_mut() + .query_pairs_mut() + .append_pair("isRecursive", &is_recursive.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -531,9 +635,7 @@ pub mod suite_test_case { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -545,67 +647,24 @@ pub mod suite_test_case { auth_header, ); } - if let Some(test_ids) = &this.test_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("testIds", test_ids); - } - if let Some(configuration_ids) = &this.configuration_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("configurationIds", configuration_ids); - } - if let Some(wit_fields) = &this.wit_fields { - req.url_mut() - .query_pairs_mut() - .append_pair("witFields", wit_fields); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(return_identity_ref) = &this.return_identity_ref { - req.url_mut() - .query_pairs_mut() - .append_pair("returnIdentityRef", &return_identity_ref.to_string()); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("expand", &expand.to_string()); - } - if let Some(exclude_flags) = &this.exclude_flags { - req.url_mut() - .query_pairs_mut() - .append_pair("excludeFlags", &exclude_flags.to_string()); - } - if let Some(is_recursive) = &this.is_recursive { - req.url_mut() - .query_pairs_mut() - .append_pair("isRecursive", &is_recursive.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -655,14 +714,49 @@ pub mod suite_test_case { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) plan_id: i32, pub(crate) suite_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -672,9 +766,7 @@ pub mod suite_test_case { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -686,28 +778,24 @@ pub mod suite_test_case { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -757,14 +845,49 @@ pub mod suite_test_case { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) plan_id: i32, pub(crate) suite_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -774,9 +897,7 @@ pub mod suite_test_case { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -788,28 +909,24 @@ pub mod suite_test_case { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -854,14 +971,52 @@ pub mod suite_test_case { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, pub(crate) suite_id: i32, pub(crate) test_ids: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let test_ids = &this.test_ids; + req.url_mut() + .query_pairs_mut() + .append_pair("testIds", test_ids); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -871,9 +1026,7 @@ pub mod suite_test_case { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -885,31 +1038,24 @@ pub mod suite_test_case { auth_header, ); } - let test_ids = &this.test_ids; - req.url_mut() - .query_pairs_mut() - .append_pair("testIds", test_ids); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -962,8 +1108,12 @@ pub mod suite_test_case { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, @@ -972,7 +1122,7 @@ pub mod suite_test_case { pub(crate) wit_fields: Option, pub(crate) return_identity_ref: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Get the list of witFields."] pub fn wit_fields(mut self, wit_fields: impl Into) -> Self { self.wit_fields = Some(wit_fields.into()); @@ -983,6 +1133,48 @@ pub mod suite_test_case { self.return_identity_ref = Some(return_identity_ref); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(wit_fields) = &this.wit_fields { + req.url_mut() + .query_pairs_mut() + .append_pair("witFields", wit_fields); + } + if let Some(return_identity_ref) = &this.return_identity_ref { + req.url_mut() + .query_pairs_mut() + .append_pair("returnIdentityRef", &return_identity_ref.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase/{}", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id, + self.test_case_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -991,9 +1183,7 @@ pub mod suite_test_case { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1005,38 +1195,24 @@ pub mod suite_test_case { auth_header, ); } - if let Some(wit_fields) = &this.wit_fields { - req.url_mut() - .query_pairs_mut() - .append_pair("witFields", wit_fields); - } - if let Some(return_identity_ref) = &this.return_identity_ref { - req.url_mut() - .query_pairs_mut() - .append_pair("returnIdentityRef", &return_identity_ref.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestCase/{}", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id, - self.test_case_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1178,8 +1354,12 @@ pub mod test_point { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, @@ -1191,7 +1371,7 @@ pub mod test_point { pub(crate) include_point_details: Option, pub(crate) is_recursive: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "ID of test points to fetch."] pub fn test_point_ids(mut self, test_point_ids: impl Into) -> Self { self.test_point_ids = Some(test_point_ids.into()); @@ -1222,64 +1402,48 @@ pub mod test_point { self.is_recursive = Some(is_recursive); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - if let Some(test_point_ids) = &this.test_point_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("testPointIds", test_point_ids); - } - if let Some(test_case_id) = &this.test_case_id { - req.url_mut() - .query_pairs_mut() - .append_pair("testCaseId", test_case_id); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(return_identity_ref) = &this.return_identity_ref { - req.url_mut() - .query_pairs_mut() - .append_pair("returnIdentityRef", &return_identity_ref.to_string()); - } - if let Some(include_point_details) = &this.include_point_details { - req.url_mut().query_pairs_mut().append_pair( - "includePointDetails", - &include_point_details.to_string(), - ); - } - if let Some(is_recursive) = &this.is_recursive { - req.url_mut() - .query_pairs_mut() - .append_pair("isRecursive", &is_recursive.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(test_point_ids) = &this.test_point_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("testPointIds", test_point_ids); + } + if let Some(test_case_id) = &this.test_case_id { + req.url_mut() + .query_pairs_mut() + .append_pair("testCaseId", test_case_id); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(return_identity_ref) = &this.return_identity_ref { + req.url_mut() + .query_pairs_mut() + .append_pair("returnIdentityRef", &return_identity_ref.to_string()); + } + if let Some(include_point_details) = &this.include_point_details { + req.url_mut() + .query_pairs_mut() + .append_pair("includePointDetails", &include_point_details.to_string()); + } + if let Some(is_recursive) = &this.is_recursive { + req.url_mut() + .query_pairs_mut() + .append_pair("isRecursive", &is_recursive.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -1298,6 +1462,47 @@ pub mod test_point { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -1345,8 +1550,12 @@ pub mod test_point { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, @@ -1355,7 +1564,7 @@ pub mod test_point { pub(crate) return_identity_ref: Option, pub(crate) include_point_details: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If set to true, returns the AssignedTo field in TestCaseReference as IdentityRef object."] pub fn return_identity_ref(mut self, return_identity_ref: bool) -> Self { self.return_identity_ref = Some(return_identity_ref); @@ -1366,6 +1575,51 @@ pub mod test_point { self.include_point_details = Some(include_point_details); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let point_id = &this.point_id; + req.url_mut() + .query_pairs_mut() + .append_pair("pointId", point_id); + if let Some(return_identity_ref) = &this.return_identity_ref { + req.url_mut() + .query_pairs_mut() + .append_pair("returnIdentityRef", &return_identity_ref.to_string()); + } + if let Some(include_point_details) = &this.include_point_details { + req.url_mut() + .query_pairs_mut() + .append_pair("includePointDetails", &include_point_details.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestPoint", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1374,9 +1628,7 @@ pub mod test_point { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1388,42 +1640,24 @@ pub mod test_point { auth_header, ); } - let point_id = &this.point_id; - req.url_mut() - .query_pairs_mut() - .append_pair("pointId", point_id); - if let Some(return_identity_ref) = &this.return_identity_ref { - req.url_mut() - .query_pairs_mut() - .append_pair("returnIdentityRef", &return_identity_ref.to_string()); - } - if let Some(include_point_details) = &this.include_point_details { - req.url_mut().query_pairs_mut().append_pair( - "includePointDetails", - &include_point_details.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestPoint", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1473,8 +1707,12 @@ pub mod test_point { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, @@ -1483,7 +1721,7 @@ pub mod test_point { pub(crate) include_point_details: Option, pub(crate) return_identity_ref: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If set to false, will get a smaller payload containing only basic details about the test point object"] pub fn include_point_details(mut self, include_point_details: bool) -> Self { self.include_point_details = Some(include_point_details); @@ -1494,6 +1732,48 @@ pub mod test_point { self.return_identity_ref = Some(return_identity_ref); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + 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", &include_point_details.to_string()); + } + if let Some(return_identity_ref) = &this.return_identity_ref { + req.url_mut() + .query_pairs_mut() + .append_pair("returnIdentityRef", &return_identity_ref.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestPoint", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1502,9 +1782,7 @@ pub mod test_point { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1516,39 +1794,24 @@ pub mod test_point { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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", - &include_point_details.to_string(), - ); - } - if let Some(return_identity_ref) = &this.return_identity_ref { - req.url_mut() - .query_pairs_mut() - .append_pair("returnIdentityRef", &return_identity_ref.to_string()); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/Suites/{}/TestPoint", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1738,11 +2001,46 @@ pub mod test_suites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) test_case_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1752,9 +2050,7 @@ pub mod test_suites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1766,28 +2062,24 @@ pub mod test_suites { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1837,8 +2129,12 @@ pub mod test_suites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, @@ -1846,7 +2142,7 @@ pub mod test_suites { pub(crate) continuation_token: Option, pub(crate) as_tree_view: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Include the children suites and testers details."] pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); @@ -1862,6 +2158,51 @@ pub mod test_suites { self.as_tree_view = Some(as_tree_view); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("expand", &expand.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(as_tree_view) = &this.as_tree_view { + req.url_mut() + .query_pairs_mut() + .append_pair("asTreeView", &as_tree_view.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/suites", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1870,9 +2211,7 @@ pub mod test_suites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1884,41 +2223,24 @@ pub mod test_suites { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("expand", &expand.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(as_tree_view) = &this.as_tree_view { - req.url_mut() - .query_pairs_mut() - .append_pair("asTreeView", &as_tree_view.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/suites", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1968,13 +2290,47 @@ pub mod test_suites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestSuiteCreateParams, pub(crate) project: String, pub(crate) plan_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/suites", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1984,9 +2340,7 @@ pub mod test_suites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1998,27 +2352,24 @@ pub mod test_suites { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/suites", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2068,52 +2419,41 @@ pub mod test_suites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, pub(crate) suite_id: i32, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Include the children suites and testers details"] pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - 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.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -2132,6 +2472,47 @@ pub mod test_suites { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -2179,14 +2560,49 @@ pub mod test_suites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestSuiteUpdateParams, pub(crate) project: String, pub(crate) plan_id: i32, pub(crate) suite_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/suites/{}", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2196,9 +2612,7 @@ pub mod test_suites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2210,28 +2624,24 @@ pub mod test_suites { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/suites/{}", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2276,13 +2686,47 @@ pub mod test_suites { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, pub(crate) suite_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/{}/suites/{}", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id, + self.suite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2292,9 +2736,7 @@ pub mod test_suites { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2306,27 +2748,24 @@ pub mod test_suites { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/{}/suites/{}", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id, - self.suite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2485,18 +2924,56 @@ pub mod configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If the list of configurations returned is not complete, a continuation token to query next batch of configurations is included in the response header as \"x-ms-continuationtoken\". Omit this parameter to get the first batch of test configurations."] pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/configurations", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2505,9 +2982,7 @@ pub mod configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2519,30 +2994,24 @@ pub mod configurations { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/configurations", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2592,12 +3061,45 @@ pub mod configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestConfigurationCreateUpdateParameters, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/configurations", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2607,9 +3109,7 @@ pub mod configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2621,26 +3121,24 @@ pub mod configurations { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/configurations", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2690,13 +3188,50 @@ pub mod configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestConfigurationCreateUpdateParameters, pub(crate) project: String, pub(crate) test_configuartion_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/configurations", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2706,9 +3241,7 @@ pub mod configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2720,30 +3253,24 @@ pub mod configurations { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/configurations", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2788,12 +3315,48 @@ pub mod configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) test_configuartion_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/configurations", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2803,9 +3366,7 @@ pub mod configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2817,29 +3378,24 @@ pub mod configurations { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/configurations", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2892,12 +3448,45 @@ pub mod configurations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) test_configuration_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/configurations/{}", + self.client.endpoint(), + self.organization, + self.project, + self.test_configuration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2907,9 +3496,7 @@ pub mod configurations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2921,26 +3508,24 @@ pub mod configurations { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/configurations/{}", - self.client.endpoint(), - self.organization, - self.project, - self.test_configuration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3099,8 +3684,12 @@ pub mod test_plans { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) owner: Option, @@ -3108,7 +3697,7 @@ pub mod test_plans { pub(crate) include_plan_details: Option, pub(crate) filter_active_plans: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Filter for test plan by owner ID or name"] pub fn owner(mut self, owner: impl Into) -> Self { self.owner = Some(owner.into()); @@ -3129,6 +3718,53 @@ pub mod test_plans { self.filter_active_plans = Some(filter_active_plans); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(owner) = &this.owner { + req.url_mut().query_pairs_mut().append_pair("owner", owner); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(include_plan_details) = &this.include_plan_details { + req.url_mut() + .query_pairs_mut() + .append_pair("includePlanDetails", &include_plan_details.to_string()); + } + if let Some(filter_active_plans) = &this.filter_active_plans { + req.url_mut() + .query_pairs_mut() + .append_pair("filterActivePlans", &filter_active_plans.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/plans", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3137,9 +3773,7 @@ pub mod test_plans { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3151,44 +3785,24 @@ pub mod test_plans { auth_header, ); } - if let Some(owner) = &this.owner { - req.url_mut().query_pairs_mut().append_pair("owner", owner); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(include_plan_details) = &this.include_plan_details { - req.url_mut().query_pairs_mut().append_pair( - "includePlanDetails", - &include_plan_details.to_string(), - ); - } - if let Some(filter_active_plans) = &this.filter_active_plans { - req.url_mut() - .query_pairs_mut() - .append_pair("filterActivePlans", &filter_active_plans.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/plans", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3238,12 +3852,45 @@ pub mod test_plans { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestPlanCreateParams, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/plans", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3253,9 +3900,7 @@ pub mod test_plans { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3267,26 +3912,24 @@ pub mod test_plans { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/plans", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3336,12 +3979,45 @@ pub mod test_plans { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/plans/{}", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3351,9 +4027,7 @@ pub mod test_plans { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3365,26 +4039,24 @@ pub mod test_plans { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/plans/{}", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3434,13 +4106,47 @@ pub mod test_plans { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestPlanUpdateParams, pub(crate) project: String, pub(crate) plan_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/plans/{}", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3450,9 +4156,7 @@ pub mod test_plans { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3464,27 +4168,24 @@ pub mod test_plans { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/plans/{}", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3529,12 +4230,45 @@ pub mod test_plans { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) plan_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/plans/{}", + self.client.endpoint(), + self.organization, + self.project, + self.plan_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3544,9 +4278,7 @@ pub mod test_plans { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3558,26 +4290,24 @@ pub mod test_plans { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/plans/{}", - self.client.endpoint(), - self.organization, - self.project, - self.plan_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3684,19 +4414,58 @@ pub mod test_plan_clone { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CloneTestPlanParams, pub(crate) project: String, pub(crate) deep_clone: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Clones all the associated test cases as well"] pub fn deep_clone(mut self, deep_clone: bool) -> Self { self.deep_clone = Some(deep_clone); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/CloneOperation", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3705,9 +4474,7 @@ pub mod test_plan_clone { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3719,31 +4486,24 @@ pub mod test_plan_clone { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/CloneOperation", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3799,12 +4559,45 @@ pub mod test_plan_clone { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) clone_operation_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Plans/CloneOperation/{}", + self.client.endpoint(), + self.organization, + self.project, + self.clone_operation_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3814,9 +4607,7 @@ pub mod test_plan_clone { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3828,26 +4619,24 @@ pub mod test_plan_clone { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Plans/CloneOperation/{}", - self.client.endpoint(), - self.organization, - self.project, - self.clone_operation_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3950,14 +4739,18 @@ pub mod test_suite_entry { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) suite_id: i32, pub(crate) suite_entry_type: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn suite_entry_type( mut self, suite_entry_type: impl Into, @@ -3965,6 +4758,41 @@ pub mod test_suite_entry { self.suite_entry_type = Some(suite_entry_type.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(suite_entry_type) = &this.suite_entry_type { + req.url_mut() + .query_pairs_mut() + .append_pair("suiteEntryType", &suite_entry_type.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/suiteentry/{}", + self.client.endpoint(), + self.organization, + self.project, + self.suite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3973,9 +4801,7 @@ pub mod test_suite_entry { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3987,31 +4813,24 @@ pub mod test_suite_entry { auth_header, ); } - if let Some(suite_entry_type) = &this.suite_entry_type { - req.url_mut() - .query_pairs_mut() - .append_pair("suiteEntryType", &suite_entry_type.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/suiteentry/{}", - self.client.endpoint(), - self.organization, - self.project, - self.suite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4061,13 +4880,47 @@ pub mod test_suite_entry { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) suite_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/suiteentry/{}", + self.client.endpoint(), + self.organization, + self.project, + self.suite_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4077,9 +4930,7 @@ pub mod test_suite_entry { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4091,27 +4942,24 @@ pub mod test_suite_entry { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/suiteentry/{}", - self.client.endpoint(), - self.organization, - self.project, - self.suite_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4215,19 +5063,58 @@ pub mod test_suite_clone { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CloneTestSuiteParams, pub(crate) project: String, pub(crate) deep_clone: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Clones all the associated test cases as well"] pub fn deep_clone(mut self, deep_clone: bool) -> Self { self.deep_clone = Some(deep_clone); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Suites/CloneOperation", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4236,9 +5123,7 @@ pub mod test_suite_clone { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4250,31 +5135,24 @@ pub mod test_suite_clone { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Suites/CloneOperation", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4330,12 +5208,45 @@ pub mod test_suite_clone { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) clone_operation_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/Suites/CloneOperation/{}", + self.client.endpoint(), + self.organization, + self.project, + self.clone_operation_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4345,9 +5256,7 @@ pub mod test_suite_clone { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4359,26 +5268,24 @@ pub mod test_suite_clone { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/Suites/CloneOperation/{}", - self.client.endpoint(), - self.organization, - self.project, - self.clone_operation_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4453,12 +5360,45 @@ pub mod test_cases { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) test_case_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/testcases/{}", + self.client.endpoint(), + self.organization, + self.project, + self.test_case_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4468,9 +5408,7 @@ pub mod test_cases { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4482,26 +5420,24 @@ pub mod test_cases { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/testcases/{}", - self.client.endpoint(), - self.organization, - self.project, - self.test_case_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4604,12 +5540,45 @@ pub mod test_case_clone { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CloneTestCaseParams, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/TestCases/CloneTestCaseOperation", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4619,9 +5588,7 @@ pub mod test_case_clone { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4633,26 +5600,24 @@ pub mod test_case_clone { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/TestCases/CloneTestCaseOperation", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4708,12 +5673,45 @@ pub mod test_case_clone { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) clone_operation_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/TestCases/CloneTestCaseOperation/{}", + self.client.endpoint(), + self.organization, + self.project, + self.clone_operation_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4723,9 +5721,7 @@ pub mod test_case_clone { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4737,26 +5733,24 @@ pub mod test_case_clone { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/TestCases/CloneTestCaseOperation/{}", - self.client.endpoint(), - self.organization, - self.project, - self.clone_operation_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4913,50 +5907,39 @@ pub mod variables { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If the list of variables returned is not complete, a continuation token to query next batch of variables is included in the response header as \"x-ms-continuationtoken\". Omit this parameter to get the first batch of test variables."] pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { self.continuation_token = Some(continuation_token.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - 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::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -4973,6 +5956,47 @@ pub mod variables { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -5020,12 +6044,45 @@ pub mod variables { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestVariableCreateUpdateParameters, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/variables", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5035,9 +6092,7 @@ pub mod variables { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5049,26 +6104,24 @@ pub mod variables { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/variables", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5118,12 +6171,45 @@ pub mod variables { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) test_variable_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/variables/{}", + self.client.endpoint(), + self.organization, + self.project, + self.test_variable_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5133,9 +6219,7 @@ pub mod variables { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5147,26 +6231,24 @@ pub mod variables { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/variables/{}", - self.client.endpoint(), - self.organization, - self.project, - self.test_variable_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5216,13 +6298,47 @@ pub mod variables { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestVariableCreateUpdateParameters, pub(crate) project: String, pub(crate) test_variable_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/variables/{}", + self.client.endpoint(), + self.organization, + self.project, + self.test_variable_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5232,9 +6348,7 @@ pub mod variables { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5246,27 +6360,24 @@ pub mod variables { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/variables/{}", - self.client.endpoint(), - self.organization, - self.project, - self.test_variable_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5311,12 +6422,45 @@ pub mod variables { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) test_variable_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testplan/variables/{}", + self.client.endpoint(), + self.organization, + self.project, + self.test_variable_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5326,9 +6470,7 @@ pub mod variables { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5340,26 +6482,24 @@ pub mod variables { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testplan/variables/{}", - self.client.endpoint(), - self.organization, - self.project, - self.test_variable_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5379,3 +6519,889 @@ pub mod variables { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn configurations_client(&self) -> configurations::Client { + configurations::Client(self.clone()) + } + pub fn suite_test_case_client(&self) -> suite_test_case::Client { + suite_test_case::Client(self.clone()) + } + pub fn test_case_clone_client(&self) -> test_case_clone::Client { + test_case_clone::Client(self.clone()) + } + pub fn test_cases_client(&self) -> test_cases::Client { + test_cases::Client(self.clone()) + } + pub fn test_plan_clone_client(&self) -> test_plan_clone::Client { + test_plan_clone::Client(self.clone()) + } + pub fn test_plans_client(&self) -> test_plans::Client { + test_plans::Client(self.clone()) + } + pub fn test_point_client(&self) -> test_point::Client { + test_point::Client(self.clone()) + } + pub fn test_suite_clone_client(&self) -> test_suite_clone::Client { + test_suite_clone::Client(self.clone()) + } + pub fn test_suite_entry_client(&self) -> test_suite_entry::Client { + test_suite_entry::Client(self.clone()) + } + pub fn test_suites_client(&self) -> test_suites::Client { + test_suites::Client(self.clone()) + } + pub fn variables_client(&self) -> variables::Client { + variables::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod suite_test_case { + use super::super::models; + use super::super::suite_test_case::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Removes test cases from a suite based on the list of test case Ids provided."] + #[doc = ""] + #[doc = "See [`remove_test_cases_from_suite`](super::super::suite_test_case::Client::remove_test_cases_from_suite) for details of the arguments."] + pub fn remove_test_cases_from_suite( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + test_case_ids: impl Into, + ) -> remove_test_cases_from_suite::RequestBuilder { + remove_test_cases_from_suite::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + test_case_ids: test_case_ids.into(), + } + } + #[doc = "Get Test Case List return those test cases which have all the configuration Ids as mentioned in the optional parameter. If configuration Ids is null, it return all the test cases"] + #[doc = ""] + #[doc = "See [`get_test_case_list`](super::super::suite_test_case::Client::get_test_case_list) for details of the arguments."] + pub fn get_test_case_list( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + ) -> get_test_case_list::RequestBuilder { + get_test_case_list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + test_ids: None, + configuration_ids: None, + wit_fields: None, + continuation_token: None, + return_identity_ref: None, + expand: None, + exclude_flags: None, + is_recursive: None, + } + } + #[doc = "Add test cases to a suite with specified configurations"] + #[doc = ""] + #[doc = "See [`add`](super::super::suite_test_case::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + plan_id: i32, + suite_id: i32, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + plan_id, + suite_id, + } + } + #[doc = "Update the configurations for test cases"] + #[doc = ""] + #[doc = "See [`update`](super::super::suite_test_case::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + plan_id: i32, + suite_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + plan_id, + suite_id, + } + } + #[doc = "Removes test cases from a suite based on the list of test case Ids provided. This API can be used to remove a larger number of test cases."] + #[doc = ""] + #[doc = "See [`remove_test_cases_list_from_suite`](super::super::suite_test_case::Client::remove_test_cases_list_from_suite) for details of the arguments."] + pub fn remove_test_cases_list_from_suite( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + test_ids: impl Into, + ) -> remove_test_cases_list_from_suite::RequestBuilder { + remove_test_cases_list_from_suite::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + test_ids: test_ids.into(), + } + } + #[doc = "Get a particular Test Case from a Suite."] + #[doc = ""] + #[doc = "See [`get_test_case`](super::super::suite_test_case::Client::get_test_case) for details of the arguments."] + pub fn get_test_case( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + test_case_id: impl Into, + ) -> get_test_case::RequestBuilder { + get_test_case::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + test_case_id: test_case_id.into(), + wit_fields: None, + return_identity_ref: None, + } + } + } + } + pub mod test_point { + use super::super::models; + use super::super::test_point::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all the points inside a suite based on some filters"] + #[doc = ""] + #[doc = "See [`get_points_list`](super::super::test_point::Client::get_points_list) for details of the arguments."] + pub fn get_points_list( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + ) -> get_points_list::RequestBuilder { + get_points_list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + test_point_ids: None, + test_case_id: None, + continuation_token: None, + return_identity_ref: None, + include_point_details: None, + is_recursive: None, + } + } + #[doc = "Get a particular Test Point from a suite."] + #[doc = ""] + #[doc = "See [`get_points`](super::super::test_point::Client::get_points) for details of the arguments."] + pub fn get_points( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + point_id: impl Into, + ) -> get_points::RequestBuilder { + get_points::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + point_id: point_id.into(), + return_identity_ref: None, + include_point_details: None, + } + } + #[doc = "Update Test Points. This is used to Reset test point to active, update the outcome of a test point or update the tester of a test point"] + #[doc = ""] + #[doc = "See [`update`](super::super::test_point::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + plan_id: i32, + suite_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + plan_id, + suite_id, + include_point_details: None, + return_identity_ref: None, + } + } + } + } + pub mod test_suites { + use super::super::models; + use super::super::test_suites::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Find the list of all test suites in which a given test case is present. This is helpful if you need to find out which test suites are using a test case, when you need to make changes to a test case."] + #[doc = ""] + #[doc = "See [`get_suites_by_test_case_id`](super::super::test_suites::Client::get_suites_by_test_case_id) for details of the arguments."] + pub fn get_suites_by_test_case_id( + &self, + organization: impl Into, + test_case_id: i32, + ) -> get_suites_by_test_case_id::RequestBuilder { + get_suites_by_test_case_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + test_case_id, + } + } + #[doc = "Get test suites for plan."] + #[doc = ""] + #[doc = "See [`get_test_suites_for_plan`](super::super::test_suites::Client::get_test_suites_for_plan) for details of the arguments."] + pub fn get_test_suites_for_plan( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + ) -> get_test_suites_for_plan::RequestBuilder { + get_test_suites_for_plan::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + expand: None, + continuation_token: None, + as_tree_view: None, + } + } + #[doc = "Create test suite."] + #[doc = ""] + #[doc = "See [`create`](super::super::test_suites::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + plan_id: i32, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + plan_id, + } + } + #[doc = "Get test suite by suite id."] + #[doc = ""] + #[doc = "See [`get`](super::super::test_suites::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + expand: None, + } + } + #[doc = "Update test suite."] + #[doc = ""] + #[doc = "See [`update`](super::super::test_suites::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + plan_id, + suite_id, + } + } + #[doc = "Delete test suite."] + #[doc = ""] + #[doc = "See [`delete`](super::super::test_suites::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + suite_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + suite_id, + } + } + } + } + pub mod configurations { + use super::super::configurations::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of test configurations."] + #[doc = ""] + #[doc = "See [`list`](super::super::configurations::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + continuation_token: None, + } + } + #[doc = "Create a test configuration."] + #[doc = ""] + #[doc = "See [`create`](super::super::configurations::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Update a test configuration by its ID."] + #[doc = ""] + #[doc = "See [`update`](super::super::configurations::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + test_configuartion_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + test_configuartion_id, + } + } + #[doc = "Delete a test configuration by its ID."] + #[doc = ""] + #[doc = "See [`delete`](super::super::configurations::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + test_configuartion_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_configuartion_id, + } + } + #[doc = "Get a test configuration"] + #[doc = ""] + #[doc = "See [`get`](super::super::configurations::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + test_configuration_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_configuration_id, + } + } + } + } + pub mod test_plans { + use super::super::models; + use super::super::test_plans::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of test plans"] + #[doc = ""] + #[doc = "See [`list`](super::super::test_plans::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + owner: None, + continuation_token: None, + include_plan_details: None, + filter_active_plans: None, + } + } + #[doc = "Create a test plan."] + #[doc = ""] + #[doc = "See [`create`](super::super::test_plans::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get a test plan by Id."] + #[doc = ""] + #[doc = "See [`get`](super::super::test_plans::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + } + } + #[doc = "Update a test plan."] + #[doc = ""] + #[doc = "See [`update`](super::super::test_plans::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + plan_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + plan_id, + } + } + #[doc = "Delete a test plan."] + #[doc = ""] + #[doc = "See [`delete`](super::super::test_plans::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + plan_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + plan_id, + } + } + } + } + pub mod test_plan_clone { + use super::super::models; + use super::super::test_plan_clone::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Clone test plan"] + #[doc = ""] + #[doc = "See [`clone_test_plan`](super::super::test_plan_clone::Client::clone_test_plan) for details of the arguments."] + pub fn clone_test_plan( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> clone_test_plan::RequestBuilder { + clone_test_plan::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + deep_clone: None, + } + } + #[doc = "Get clone information."] + #[doc = ""] + #[doc = "See [`get`](super::super::test_plan_clone::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + clone_operation_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + clone_operation_id, + } + } + } + } + pub mod test_suite_entry { + use super::super::models; + use super::super::test_suite_entry::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of test suite entries in the test suite."] + #[doc = ""] + #[doc = "See [`list`](super::super::test_suite_entry::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + suite_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + suite_id, + suite_entry_type: None, + } + } + #[doc = "Reorder test suite entries in the test suite."] + #[doc = ""] + #[doc = "See [`reorder_suite_entries`](super::super::test_suite_entry::Client::reorder_suite_entries) for details of the arguments."] + pub fn reorder_suite_entries( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + suite_id: i32, + ) -> reorder_suite_entries::RequestBuilder { + reorder_suite_entries::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + suite_id, + } + } + } + } + pub mod test_suite_clone { + use super::super::models; + use super::super::test_suite_clone::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Clone test suite"] + #[doc = ""] + #[doc = "See [`clone_test_suite`](super::super::test_suite_clone::Client::clone_test_suite) for details of the arguments."] + pub fn clone_test_suite( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> clone_test_suite::RequestBuilder { + clone_test_suite::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + deep_clone: None, + } + } + #[doc = "Get clone information."] + #[doc = ""] + #[doc = "See [`get`](super::super::test_suite_clone::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + clone_operation_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + clone_operation_id, + } + } + } + } + pub mod test_cases { + use super::super::models; + use super::super::test_cases::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Delete a test case."] + #[doc = ""] + #[doc = "See [`delete`](super::super::test_cases::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + test_case_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_case_id, + } + } + } + } + pub mod test_case_clone { + use super::super::models; + use super::super::test_case_clone::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`clone_test_case`](super::super::test_case_clone::Client::clone_test_case) for details of the arguments."] + pub fn clone_test_case( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> clone_test_case::RequestBuilder { + clone_test_case::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get clone information."] + #[doc = ""] + #[doc = "See [`get`](super::super::test_case_clone::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + clone_operation_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + clone_operation_id, + } + } + } + } + pub mod variables { + use super::super::models; + use super::super::variables::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of test variables."] + #[doc = ""] + #[doc = "See [`list`](super::super::variables::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + continuation_token: None, + } + } + #[doc = "Create a test variable."] + #[doc = ""] + #[doc = "See [`create`](super::super::variables::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get a test variable by its ID."] + #[doc = ""] + #[doc = "See [`get`](super::super::variables::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + test_variable_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_variable_id, + } + } + #[doc = "Update a test variable by its ID."] + #[doc = ""] + #[doc = "See [`update`](super::super::variables::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + test_variable_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + test_variable_id, + } + } + #[doc = "Delete a test variable by its ID."] + #[doc = ""] + #[doc = "See [`delete`](super::super::variables::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + test_variable_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_variable_id, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/test_results/mod.rs b/azure_devops_rust_api/src/test_results/mod.rs index 00bd579f..e85916b0 100644 --- a/azure_devops_rust_api/src/test_results/mod.rs +++ b/azure_devops_rust_api/src/test_results/mod.rs @@ -363,13 +363,55 @@ pub mod codecoverage { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) flags: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let build_id = &this.build_id; + req.url_mut() + .query_pairs_mut() + .append_pair("buildId", &build_id.to_string()); + let flags = &this.flags; + req.url_mut() + .query_pairs_mut() + .append_pair("flags", &flags.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/codecoverage?buildId={}&flags={}", + self.client.endpoint(), + self.organization, + self.project, + self.build_id, + self.flags + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -379,9 +421,7 @@ pub mod codecoverage { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -393,35 +433,24 @@ pub mod codecoverage { auth_header, ); } - let build_id = &this.build_id; - req.url_mut() - .query_pairs_mut() - .append_pair("buildId", &build_id.to_string()); - let flags = &this.flags; - req.url_mut() - .query_pairs_mut() - .append_pair("flags", &flags.to_string()); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/codecoverage?buildId={}&flags={}", - self.client.endpoint(), - self.organization, - self.project, - self.build_id, - self.flags - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -471,18 +500,60 @@ pub mod codecoverage { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) delta_build_id: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn delta_build_id(mut self, delta_build_id: i32) -> Self { self.delta_build_id = Some(delta_build_id); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let build_id = &this.build_id; + req.url_mut() + .query_pairs_mut() + .append_pair("buildId", &build_id.to_string()); + if let Some(delta_build_id) = &this.delta_build_id { + req.url_mut() + .query_pairs_mut() + .append_pair("deltaBuildId", &delta_build_id.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/codecoverage", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -491,9 +562,7 @@ pub mod codecoverage { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -505,34 +574,24 @@ pub mod codecoverage { auth_header, ); } - let build_id = &this.build_id; - req.url_mut() - .query_pairs_mut() - .append_pair("buildId", &build_id.to_string()); - if let Some(delta_build_id) = &this.delta_build_id { - req.url_mut() - .query_pairs_mut() - .append_pair("deltaBuildId", &delta_build_id.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/codecoverage", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -577,18 +636,60 @@ pub mod codecoverage { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) body: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn body(mut self, body: impl Into) -> Self { self.body = Some(body.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + let build_id = &this.build_id; + req.url_mut() + .query_pairs_mut() + .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::json::to_json(body)? + } else { + azure_core::Bytes::new() + }; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/codecoverage", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -597,9 +698,7 @@ pub mod codecoverage { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -611,34 +710,24 @@ pub mod codecoverage { auth_header, ); } - let build_id = &this.build_id; - req.url_mut() - .query_pairs_mut() - .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::json::to_json(body)? - } else { - azure_core::Bytes::new() - }; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/codecoverage", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -691,13 +780,50 @@ pub mod codecoverage { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) flags: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let flags = &this.flags; + req.url_mut() + .query_pairs_mut() + .append_pair("flags", &flags.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/codecoverage", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -707,9 +833,7 @@ pub mod codecoverage { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -721,30 +845,24 @@ pub mod codecoverage { auth_header, ); } - let flags = &this.flags; - req.url_mut() - .query_pairs_mut() - .append_pair("flags", &flags.to_string()); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/codecoverage", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -930,8 +1048,12 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) min_last_updated_date: time::OffsetDateTime, @@ -951,7 +1073,7 @@ pub mod runs { pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Current state of the Runs to be queried."] pub fn state(mut self, state: impl Into) -> Self { self.state = Some(state.into()); @@ -1025,6 +1147,119 @@ pub mod runs { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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", &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", &formatted_date_time); + if let Some(state) = &this.state { + req.url_mut() + .query_pairs_mut() + .append_pair("state", &state.to_string()); + } + if let Some(plan_ids) = &this.plan_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("planIds", plan_ids); + } + if let Some(is_automated) = &this.is_automated { + req.url_mut() + .query_pairs_mut() + .append_pair("isAutomated", &is_automated.to_string()); + } + if let Some(publish_context) = &this.publish_context { + req.url_mut() + .query_pairs_mut() + .append_pair("publishContext", &publish_context.to_string()); + } + if let Some(build_ids) = &this.build_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("buildIds", build_ids); + } + if let Some(build_def_ids) = &this.build_def_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("buildDefIds", build_def_ids); + } + if let Some(branch_name) = &this.branch_name { + req.url_mut() + .query_pairs_mut() + .append_pair("branchName", branch_name); + } + if let Some(release_ids) = &this.release_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseIds", release_ids); + } + if let Some(release_def_ids) = &this.release_def_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseDefIds", release_def_ids); + } + if let Some(release_env_ids) = &this.release_env_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseEnvIds", release_env_ids); + } + if let Some(release_env_def_ids) = &this.release_env_def_ids { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseEnvDefIds", release_env_def_ids); + } + if let Some(run_title) = &this.run_title { + req.url_mut() + .query_pairs_mut() + .append_pair("runTitle", run_title); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs?minLastUpdatedDate={}&maxLastUpdatedDate={}", + self.client.endpoint(), + self.organization, + self.project, + self.min_last_updated_date, + self.max_last_updated_date + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1033,9 +1268,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1047,109 +1280,24 @@ pub mod runs { 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", &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", &formatted_date_time); - if let Some(state) = &this.state { - req.url_mut() - .query_pairs_mut() - .append_pair("state", &state.to_string()); - } - if let Some(plan_ids) = &this.plan_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("planIds", plan_ids); - } - if let Some(is_automated) = &this.is_automated { - req.url_mut() - .query_pairs_mut() - .append_pair("isAutomated", &is_automated.to_string()); - } - if let Some(publish_context) = &this.publish_context { - req.url_mut() - .query_pairs_mut() - .append_pair("publishContext", &publish_context.to_string()); - } - if let Some(build_ids) = &this.build_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("buildIds", build_ids); - } - if let Some(build_def_ids) = &this.build_def_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("buildDefIds", build_def_ids); - } - if let Some(branch_name) = &this.branch_name { - req.url_mut() - .query_pairs_mut() - .append_pair("branchName", branch_name); - } - if let Some(release_ids) = &this.release_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("releaseIds", release_ids); - } - if let Some(release_def_ids) = &this.release_def_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("releaseDefIds", release_def_ids); - } - if let Some(release_env_ids) = &this.release_env_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("releaseEnvIds", release_env_ids); - } - if let Some(release_env_def_ids) = &this.release_env_def_ids { - req.url_mut() - .query_pairs_mut() - .append_pair("releaseEnvDefIds", release_env_def_ids); - } - if let Some(run_title) = &this.run_title { - req.url_mut() - .query_pairs_mut() - .append_pair("runTitle", run_title); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs?minLastUpdatedDate={}&maxLastUpdatedDate={}", - self.client.endpoint(), - self.organization, - self.project, - self.min_last_updated_date, - self.max_last_updated_date - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1199,8 +1347,12 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_uri: Option, @@ -1212,7 +1364,7 @@ pub mod runs { pub(crate) skip: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn build_uri(mut self, build_uri: impl Into) -> Self { self.build_uri = Some(build_uri.into()); self @@ -1245,6 +1397,73 @@ pub mod runs { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(build_uri) = &this.build_uri { + req.url_mut() + .query_pairs_mut() + .append_pair("buildUri", build_uri); + } + if let Some(owner) = &this.owner { + req.url_mut().query_pairs_mut().append_pair("owner", owner); + } + if let Some(tmi_run_id) = &this.tmi_run_id { + req.url_mut() + .query_pairs_mut() + .append_pair("tmiRunId", tmi_run_id); + } + if let Some(plan_id) = &this.plan_id { + req.url_mut() + .query_pairs_mut() + .append_pair("planId", &plan_id.to_string()); + } + if let Some(include_run_details) = &this.include_run_details { + req.url_mut() + .query_pairs_mut() + .append_pair("includeRunDetails", &include_run_details.to_string()); + } + if let Some(automated) = &this.automated { + req.url_mut() + .query_pairs_mut() + .append_pair("automated", &automated.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1253,9 +1472,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1267,63 +1484,24 @@ pub mod runs { auth_header, ); } - if let Some(build_uri) = &this.build_uri { - req.url_mut() - .query_pairs_mut() - .append_pair("buildUri", build_uri); - } - if let Some(owner) = &this.owner { - req.url_mut().query_pairs_mut().append_pair("owner", owner); - } - if let Some(tmi_run_id) = &this.tmi_run_id { - req.url_mut() - .query_pairs_mut() - .append_pair("tmiRunId", tmi_run_id); - } - if let Some(plan_id) = &this.plan_id { - req.url_mut() - .query_pairs_mut() - .append_pair("planId", &plan_id.to_string()); - } - if let Some(include_run_details) = &this.include_run_details { - req.url_mut() - .query_pairs_mut() - .append_pair("includeRunDetails", &include_run_details.to_string()); - } - if let Some(automated) = &this.automated { - req.url_mut() - .query_pairs_mut() - .append_pair("automated", &automated.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1373,24 +1551,55 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::RunCreateModel, pub(crate) project: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1402,26 +1611,24 @@ pub mod runs { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1471,15 +1678,19 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) include_details: Option, pub(crate) include_tags: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn include_details(mut self, include_details: bool) -> Self { self.include_details = Some(include_details); self @@ -1488,6 +1699,46 @@ pub mod runs { self.include_tags = Some(include_tags); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_details) = &this.include_details { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDetails", &include_details.to_string()); + } + if let Some(include_tags) = &this.include_tags { + req.url_mut() + .query_pairs_mut() + .append_pair("includeTags", &include_tags.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1496,9 +1747,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1510,36 +1759,24 @@ pub mod runs { auth_header, ); } - if let Some(include_details) = &this.include_details { - req.url_mut() - .query_pairs_mut() - .append_pair("includeDetails", &include_details.to_string()); - } - if let Some(include_tags) = &this.include_tags { - req.url_mut() - .query_pairs_mut() - .append_pair("includeTags", &include_tags.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1589,13 +1826,47 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::RunUpdateModel, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1605,9 +1876,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1619,27 +1888,24 @@ pub mod runs { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1684,12 +1950,45 @@ pub mod runs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1699,9 +1998,7 @@ pub mod runs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1713,26 +2010,24 @@ pub mod runs { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1912,8 +2207,12 @@ pub mod testlog { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -1926,7 +2225,7 @@ pub mod testlog { pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "directory path of the attachment to get"] pub fn directory_path(mut self, directory_path: impl Into) -> Self { self.directory_path = Some(directory_path.into()); @@ -1952,6 +2251,70 @@ pub mod testlog { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let sub_result_id = &this.sub_result_id; + req.url_mut() + .query_pairs_mut() + .append_pair("subResultId", &sub_result_id.to_string()); + let type_ = &this.type_; + req.url_mut() + .query_pairs_mut() + .append_pair("type", &type_.to_string()); + if let Some(directory_path) = &this.directory_path { + req.url_mut() + .query_pairs_mut() + .append_pair("directoryPath", directory_path); + } + if let Some(file_name_prefix) = &this.file_name_prefix { + req.url_mut() + .query_pairs_mut() + .append_pair("fileNamePrefix", file_name_prefix); + } + if let Some(fetch_meta_data) = &this.fetch_meta_data { + req.url_mut() + .query_pairs_mut() + .append_pair("fetchMetaData", &fetch_meta_data.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.insert_header("continuationtoken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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, + self.project, + self.run_id, + self.result_id, + self.sub_result_id, + self.type_ + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1960,9 +2323,7 @@ pub mod testlog { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1974,60 +2335,24 @@ pub mod testlog { auth_header, ); } - let sub_result_id = &this.sub_result_id; - req.url_mut() - .query_pairs_mut() - .append_pair("subResultId", &sub_result_id.to_string()); - let type_ = &this.type_; - req.url_mut() - .query_pairs_mut() - .append_pair("type", &type_.to_string()); - if let Some(directory_path) = &this.directory_path { - req.url_mut() - .query_pairs_mut() - .append_pair("directoryPath", directory_path); - } - if let Some(file_name_prefix) = &this.file_name_prefix { - req.url_mut() - .query_pairs_mut() - .append_pair("fileNamePrefix", file_name_prefix); - } - if let Some(fetch_meta_data) = &this.fetch_meta_data { - req.url_mut() - .query_pairs_mut() - .append_pair("fetchMetaData", &fetch_meta_data.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.insert_header("continuationtoken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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, - self.project, - self.run_id, - self.result_id, - self.sub_result_id, - self.type_ - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2077,8 +2402,12 @@ pub mod testlog { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -2090,7 +2419,7 @@ pub mod testlog { pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Directory path of attachments to get"] pub fn directory_path(mut self, directory_path: impl Into) -> Self { self.directory_path = Some(directory_path.into()); @@ -2116,6 +2445,64 @@ pub mod testlog { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let type_ = &this.type_; + req.url_mut() + .query_pairs_mut() + .append_pair("type", &type_.to_string()); + if let Some(directory_path) = &this.directory_path { + req.url_mut() + .query_pairs_mut() + .append_pair("directoryPath", directory_path); + } + if let Some(file_name_prefix) = &this.file_name_prefix { + req.url_mut() + .query_pairs_mut() + .append_pair("fileNamePrefix", file_name_prefix); + } + if let Some(fetch_meta_data) = &this.fetch_meta_data { + req.url_mut() + .query_pairs_mut() + .append_pair("fetchMetaData", &fetch_meta_data.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.insert_header("continuationtoken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlog", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2124,9 +2511,7 @@ pub mod testlog { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2138,54 +2523,24 @@ pub mod testlog { auth_header, ); } - let type_ = &this.type_; - req.url_mut() - .query_pairs_mut() - .append_pair("type", &type_.to_string()); - if let Some(directory_path) = &this.directory_path { - req.url_mut() - .query_pairs_mut() - .append_pair("directoryPath", directory_path); - } - if let Some(file_name_prefix) = &this.file_name_prefix { - req.url_mut() - .query_pairs_mut() - .append_pair("fileNamePrefix", file_name_prefix); - } - if let Some(fetch_meta_data) = &this.fetch_meta_data { - req.url_mut() - .query_pairs_mut() - .append_pair("fetchMetaData", &fetch_meta_data.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.insert_header("continuationtoken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlog", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2235,8 +2590,12 @@ pub mod testlog { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -2247,7 +2606,7 @@ pub mod testlog { pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "directory path for which attachments are needed"] pub fn directory_path(mut self, directory_path: impl Into) -> Self { self.directory_path = Some(directory_path.into()); @@ -2273,60 +2632,45 @@ pub mod testlog { self.continuation_token = Some(continuation_token.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - let type_ = &this.type_; - req.url_mut() - .query_pairs_mut() - .append_pair("type", &type_.to_string()); - if let Some(directory_path) = &this.directory_path { - req.url_mut() - .query_pairs_mut() - .append_pair("directoryPath", directory_path); - } - if let Some(file_name_prefix) = &this.file_name_prefix { - req.url_mut() - .query_pairs_mut() - .append_pair("fileNamePrefix", file_name_prefix); - } - if let Some(fetch_meta_data) = &this.fetch_meta_data { - req.url_mut() - .query_pairs_mut() - .append_pair("fetchMetaData", &fetch_meta_data.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.insert_header("continuationtoken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let type_ = &this.type_; + req.url_mut() + .query_pairs_mut() + .append_pair("type", &type_.to_string()); + if let Some(directory_path) = &this.directory_path { + req.url_mut() + .query_pairs_mut() + .append_pair("directoryPath", directory_path); + } + if let Some(file_name_prefix) = &this.file_name_prefix { + req.url_mut() + .query_pairs_mut() + .append_pair("fileNamePrefix", file_name_prefix); + } + if let Some(fetch_meta_data) = &this.fetch_meta_data { + req.url_mut() + .query_pairs_mut() + .append_pair("fetchMetaData", &fetch_meta_data.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.insert_header("continuationtoken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -2344,6 +2688,47 @@ pub mod testlog { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -2391,8 +2776,12 @@ pub mod testlog { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, @@ -2403,7 +2792,7 @@ pub mod testlog { pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "directory path for which attachments are needed"] pub fn directory_path(mut self, directory_path: impl Into) -> Self { self.directory_path = Some(directory_path.into()); @@ -2429,6 +2818,66 @@ pub mod testlog { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let build_id = &this.build_id; + req.url_mut() + .query_pairs_mut() + .append_pair("buildId", &build_id.to_string()); + let type_ = &this.type_; + req.url_mut() + .query_pairs_mut() + .append_pair("type", &type_.to_string()); + if let Some(directory_path) = &this.directory_path { + req.url_mut() + .query_pairs_mut() + .append_pair("directoryPath", directory_path); + } + if let Some(file_name_prefix) = &this.file_name_prefix { + req.url_mut() + .query_pairs_mut() + .append_pair("fileNamePrefix", file_name_prefix); + } + if let Some(fetch_meta_data) = &this.fetch_meta_data { + req.url_mut() + .query_pairs_mut() + .append_pair("fetchMetaData", &fetch_meta_data.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.insert_header("continuationtoken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/testlog", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2437,9 +2886,7 @@ pub mod testlog { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2451,56 +2898,24 @@ pub mod testlog { auth_header, ); } - let build_id = &this.build_id; - req.url_mut() - .query_pairs_mut() - .append_pair("buildId", &build_id.to_string()); - let type_ = &this.type_; - req.url_mut() - .query_pairs_mut() - .append_pair("type", &type_.to_string()); - if let Some(directory_path) = &this.directory_path { - req.url_mut() - .query_pairs_mut() - .append_pair("directoryPath", directory_path); - } - if let Some(file_name_prefix) = &this.file_name_prefix { - req.url_mut() - .query_pairs_mut() - .append_pair("fileNamePrefix", file_name_prefix); - } - if let Some(fetch_meta_data) = &this.fetch_meta_data { - req.url_mut() - .query_pairs_mut() - .append_pair("fetchMetaData", &fetch_meta_data.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.insert_header("continuationtoken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testlog", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2749,8 +3164,12 @@ pub mod testlogstoreendpoint { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -2759,6 +3178,41 @@ pub mod testlogstoreendpoint { pub(crate) type_: models::TestLogType, pub(crate) file_path: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let sub_result_id = &this.sub_result_id; + req.url_mut() + .query_pairs_mut() + .append_pair("subResultId", &sub_result_id.to_string()); + let type_ = &this.type_; + req.url_mut() + .query_pairs_mut() + .append_pair("type", &type_.to_string()); + let file_path = &this.file_path; + req.url_mut() + .query_pairs_mut() + .append_pair("filePath", file_path); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2768,9 +3222,7 @@ pub mod testlogstoreendpoint { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2782,32 +3234,24 @@ pub mod testlogstoreendpoint { auth_header, ); } - let sub_result_id = &this.sub_result_id; - req.url_mut() - .query_pairs_mut() - .append_pair("subResultId", &sub_result_id.to_string()); - let type_ = &this.type_; - req.url_mut() - .query_pairs_mut() - .append_pair("type", &type_.to_string()); - let file_path = &this.file_path; - req.url_mut() - .query_pairs_mut() - .append_pair("filePath", file_path); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2861,8 +3305,12 @@ pub mod testlogstoreendpoint { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -2870,6 +3318,44 @@ pub mod testlogstoreendpoint { pub(crate) type_: models::TestLogType, pub(crate) file_path: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let type_ = &this.type_; + req.url_mut() + .query_pairs_mut() + .append_pair("type", &type_.to_string()); + let file_path = &this.file_path; + req.url_mut() + .query_pairs_mut() + .append_pair("filePath", file_path); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2879,9 +3365,7 @@ pub mod testlogstoreendpoint { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2893,35 +3377,24 @@ pub mod testlogstoreendpoint { auth_header, ); } - let type_ = &this.type_; - req.url_mut() - .query_pairs_mut() - .append_pair("type", &type_.to_string()); - let file_path = &this.file_path; - req.url_mut() - .query_pairs_mut() - .append_pair("filePath", file_path); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2975,8 +3448,12 @@ pub mod testlogstoreendpoint { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -2985,6 +3462,49 @@ pub mod testlogstoreendpoint { pub(crate) file_path: String, pub(crate) type_: models::TestLogType, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + let sub_result_id = &this.sub_result_id; + req.url_mut() + .query_pairs_mut() + .append_pair("subResultId", &sub_result_id.to_string()); + let file_path = &this.file_path; + req.url_mut() + .query_pairs_mut() + .append_pair("filePath", file_path); + let type_ = &this.type_; + req.url_mut() + .query_pairs_mut() + .append_pair("type", &type_.to_string()); + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2994,9 +3514,7 @@ pub mod testlogstoreendpoint { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3008,40 +3526,24 @@ pub mod testlogstoreendpoint { auth_header, ); } - let sub_result_id = &this.sub_result_id; - req.url_mut() - .query_pairs_mut() - .append_pair("subResultId", &sub_result_id.to_string()); - let file_path = &this.file_path; - req.url_mut() - .query_pairs_mut() - .append_pair("filePath", file_path); - let type_ = &this.type_; - req.url_mut() - .query_pairs_mut() - .append_pair("type", &type_.to_string()); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/testlogstoreendpoint", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3095,14 +3597,55 @@ pub mod testlogstoreendpoint { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) type_: models::TestLogType, pub(crate) file_path: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let type_ = &this.type_; + req.url_mut() + .query_pairs_mut() + .append_pair("type", &type_.to_string()); + let file_path = &this.file_path; + req.url_mut() + .query_pairs_mut() + .append_pair("filePath", file_path); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/testlogstoreendpoint", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3112,9 +3655,7 @@ pub mod testlogstoreendpoint { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3126,34 +3667,24 @@ pub mod testlogstoreendpoint { auth_header, ); } - let type_ = &this.type_; - req.url_mut() - .query_pairs_mut() - .append_pair("type", &type_.to_string()); - let file_path = &this.file_path; - req.url_mut() - .query_pairs_mut() - .append_pair("filePath", file_path); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/testlogstoreendpoint", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3207,8 +3738,12 @@ pub mod testlogstoreendpoint { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -3216,7 +3751,7 @@ pub mod testlogstoreendpoint { pub(crate) file_path: Option, pub(crate) type_: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "file path to create an empty file"] pub fn file_path(mut self, file_path: impl Into) -> Self { self.file_path = Some(file_path.into()); @@ -3227,6 +3762,52 @@ pub mod testlogstoreendpoint { self.type_ = Some(type_.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + let test_log_store_operation_type = &this.test_log_store_operation_type; + req.url_mut().query_pairs_mut().append_pair( + "testLogStoreOperationType", + &test_log_store_operation_type.to_string(), + ); + if let Some(file_path) = &this.file_path { + req.url_mut() + .query_pairs_mut() + .append_pair("filePath", file_path); + } + if let Some(type_) = &this.type_ { + req.url_mut() + .query_pairs_mut() + .append_pair("type", &type_.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/testlogstoreendpoint", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3235,9 +3816,7 @@ pub mod testlogstoreendpoint { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3249,42 +3828,24 @@ pub mod testlogstoreendpoint { auth_header, ); } - let test_log_store_operation_type = &this.test_log_store_operation_type; - req.url_mut().query_pairs_mut().append_pair( - "testLogStoreOperationType", - &test_log_store_operation_type.to_string(), - ); - if let Some(file_path) = &this.file_path { - req.url_mut() - .query_pairs_mut() - .append_pair("filePath", file_path); - } - if let Some(type_) = &this.type_ { - req.url_mut() - .query_pairs_mut() - .append_pair("type", &type_.to_string()); - } - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/testlogstoreendpoint", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3338,26 +3899,68 @@ pub mod testlogstoreendpoint { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build: i32, pub(crate) type_: models::TestLogType, pub(crate) file_path: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let build = &this.build; + req.url_mut() + .query_pairs_mut() + .append_pair("build", &build.to_string()); + let type_ = &this.type_; + req.url_mut() + .query_pairs_mut() + .append_pair("type", &type_.to_string()); + let file_path = &this.file_path; + req.url_mut() + .query_pairs_mut() + .append_pair("filePath", file_path); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/testlogstoreendpoint", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3369,37 +3972,24 @@ pub mod testlogstoreendpoint { auth_header, ); } - let build = &this.build; - req.url_mut() - .query_pairs_mut() - .append_pair("build", &build.to_string()); - let type_ = &this.type_; - req.url_mut() - .query_pairs_mut() - .append_pair("type", &type_.to_string()); - let file_path = &this.file_path; - req.url_mut() - .query_pairs_mut() - .append_pair("filePath", file_path); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testlogstoreendpoint", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3453,13 +4043,55 @@ pub mod testlogstoreendpoint { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, pub(crate) test_log_store_operation_type: models::TestLogStoreOperationType, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + let build_id = &this.build_id; + req.url_mut() + .query_pairs_mut() + .append_pair("buildId", &build_id.to_string()); + let test_log_store_operation_type = &this.test_log_store_operation_type; + req.url_mut().query_pairs_mut().append_pair( + "testLogStoreOperationType", + &test_log_store_operation_type.to_string(), + ); + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/testlogstoreendpoint", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3469,9 +4101,7 @@ pub mod testlogstoreendpoint { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3483,35 +4113,24 @@ pub mod testlogstoreendpoint { auth_header, ); } - let build_id = &this.build_id; - req.url_mut() - .query_pairs_mut() - .append_pair("buildId", &build_id.to_string()); - let test_log_store_operation_type = &this.test_log_store_operation_type; - req.url_mut().query_pairs_mut().append_pair( - "testLogStoreOperationType", - &test_log_store_operation_type.to_string(), - ); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testlogstoreendpoint", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3839,14 +4458,53 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_case_result_id: i32, pub(crate) test_sub_result_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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.test_sub_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3856,9 +4514,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3870,32 +4526,24 @@ pub mod attachments { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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.test_sub_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3948,8 +4596,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestAttachmentRequestModel, pub(crate) project: String, @@ -3957,6 +4609,42 @@ pub mod attachments { pub(crate) test_case_result_id: i32, pub(crate) test_sub_result_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&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.test_sub_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3966,9 +4654,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3980,33 +4666,24 @@ pub mod attachments { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&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.test_sub_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4060,8 +4737,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestAttachmentRequestModel, pub(crate) project: String, @@ -4070,11 +4751,53 @@ pub mod attachments { pub(crate) iteration_id: i32, pub(crate) action_path: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn action_path(mut self, action_path: impl Into) -> Self { self.action_path = Some(action_path.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + let iteration_id = &this.iteration_id; + req.url_mut() + .query_pairs_mut() + .append_pair("iterationId", &iteration_id.to_string()); + if let Some(action_path) = &this.action_path { + req.url_mut() + .query_pairs_mut() + .append_pair("actionPath", action_path); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments?iterationId={}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4083,9 +4806,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4097,38 +4818,24 @@ pub mod attachments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - let iteration_id = &this.iteration_id; - req.url_mut() - .query_pairs_mut() - .append_pair("iterationId", &iteration_id.to_string()); - if let Some(action_path) = &this.action_path { - req.url_mut() - .query_pairs_mut() - .append_pair("actionPath", action_path); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments?iterationId={}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4177,8 +4884,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -4186,6 +4897,33 @@ pub mod attachments { pub(crate) attachment_id: i32, pub(crate) test_sub_result_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4195,9 +4933,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4209,24 +4945,24 @@ pub mod attachments { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4274,8 +5010,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -4283,6 +5023,42 @@ pub mod attachments { pub(crate) attachment_id: i32, pub(crate) iteration_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let iteration_id = &this.iteration_id; + req.url_mut() + .query_pairs_mut() + .append_pair("iterationId", &iteration_id.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments/{}?iterationId={}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id, + self.attachment_id, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4292,9 +5068,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4306,33 +5080,24 @@ pub mod attachments { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments/{}?iterationId={}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id, - self.attachment_id, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4382,12 +5147,45 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/attachments", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4397,9 +5195,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4411,26 +5207,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/attachments", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4483,13 +5277,47 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestAttachmentRequestModel, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/attachments", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4499,9 +5327,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4513,27 +5339,24 @@ pub mod attachments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/attachments", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4582,13 +5405,47 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) attachment_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/attachments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.attachment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4598,9 +5455,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4612,27 +5467,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/attachments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.attachment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4677,13 +5529,47 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) attachment_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/attachments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.attachment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4693,9 +5579,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4707,27 +5591,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/attachments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.attachment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4780,13 +5661,47 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_case_result_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4796,9 +5711,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4810,27 +5723,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4883,14 +5793,49 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestAttachmentRequestModel, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_case_result_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4900,9 +5845,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4914,28 +5857,24 @@ pub mod attachments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4984,14 +5923,49 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_case_result_id: i32, pub(crate) attachment_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id, + self.attachment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5001,9 +5975,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5015,28 +5987,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id, - self.attachment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5081,14 +6049,49 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_case_result_id: i32, pub(crate) attachment_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id, + self.attachment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5098,9 +6101,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5112,28 +6113,24 @@ pub mod attachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/attachments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id, - self.attachment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5301,13 +6298,51 @@ pub mod testattachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) filename: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let filename = &this.filename; + req.url_mut() + .query_pairs_mut() + .append_pair("filename", filename); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/testattachments?filename={}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.filename + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5317,9 +6352,7 @@ pub mod testattachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5331,31 +6364,24 @@ pub mod testattachments { auth_header, ); } - let filename = &this.filename; - req.url_mut() - .query_pairs_mut() - .append_pair("filename", filename); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/testattachments?filename={}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.filename - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5408,12 +6434,45 @@ pub mod testattachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/testattachments", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5423,9 +6482,7 @@ pub mod testattachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5437,26 +6494,24 @@ pub mod testattachments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/testattachments", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5510,13 +6565,47 @@ pub mod testattachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestAttachmentRequestModel, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/testattachments", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5526,9 +6615,7 @@ pub mod testattachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5540,27 +6627,24 @@ pub mod testattachments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/testattachments", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5606,13 +6690,50 @@ pub mod testattachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) filename: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let filename = &this.filename; + req.url_mut() + .query_pairs_mut() + .append_pair("filename", filename); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/testattachments", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5622,9 +6743,7 @@ pub mod testattachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5636,30 +6755,24 @@ pub mod testattachments { auth_header, ); } - let filename = &this.filename; - req.url_mut() - .query_pairs_mut() - .append_pair("filename", filename); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/testattachments", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5707,13 +6820,47 @@ pub mod testattachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestAttachmentRequestModel, pub(crate) project: String, pub(crate) build_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/uploadbuildattachments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.build_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5723,9 +6870,7 @@ pub mod testattachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5737,27 +6882,24 @@ pub mod testattachments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/uploadbuildattachments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.build_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5872,13 +7014,55 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, pub(crate) release_env_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let release_id = &this.release_id; + req.url_mut() + .query_pairs_mut() + .append_pair("releaseId", &release_id.to_string()); + let release_env_id = &this.release_env_id; + req.url_mut() + .query_pairs_mut() + .append_pair("releaseEnvId", &release_env_id.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/tags?releaseId={}&releaseEnvId={}", + self.client.endpoint(), + self.organization, + self.project, + self.release_id, + self.release_env_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5888,9 +7072,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5902,35 +7084,24 @@ pub mod tags { auth_header, ); } - let release_id = &this.release_id; - req.url_mut() - .query_pairs_mut() - .append_pair("releaseId", &release_id.to_string()); - let release_env_id = &this.release_env_id; - req.url_mut() - .query_pairs_mut() - .append_pair("releaseEnvId", &release_env_id.to_string()); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/tags?releaseId={}&releaseEnvId={}", - self.client.endpoint(), - self.organization, - self.project, - self.release_id, - self.release_env_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5980,13 +7151,47 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestTagsUpdateModel, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/tags", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5996,9 +7201,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6010,27 +7213,24 @@ pub mod tags { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/tags", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6080,12 +7280,48 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let build_id = &this.build_id; + req.url_mut() + .query_pairs_mut() + .append_pair("buildId", &build_id.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/tags", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6095,9 +7331,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6109,29 +7343,24 @@ pub mod tags { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/tags", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6225,13 +7454,55 @@ pub mod tagsummary { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, pub(crate) release_env_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let release_id = &this.release_id; + req.url_mut() + .query_pairs_mut() + .append_pair("releaseId", &release_id.to_string()); + let release_env_id = &this.release_env_id; + req.url_mut() + .query_pairs_mut() + .append_pair("releaseEnvId", &release_env_id.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/tagsummary?releaseId={}&releaseEnvId={}", + self.client.endpoint(), + self.organization, + self.project, + self.release_id, + self.release_env_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6241,9 +7512,7 @@ pub mod tagsummary { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6255,35 +7524,24 @@ pub mod tagsummary { auth_header, ); } - let release_id = &this.release_id; - req.url_mut() - .query_pairs_mut() - .append_pair("releaseId", &release_id.to_string()); - let release_env_id = &this.release_env_id; - req.url_mut() - .query_pairs_mut() - .append_pair("releaseEnvId", &release_env_id.to_string()); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/tagsummary?releaseId={}&releaseEnvId={}", - self.client.endpoint(), - self.organization, - self.project, - self.release_id, - self.release_env_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6333,12 +7591,48 @@ pub mod tagsummary { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let build_id = &this.build_id; + req.url_mut() + .query_pairs_mut() + .append_pair("buildId", &build_id.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/tagsummary", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6348,9 +7642,7 @@ pub mod tagsummary { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6362,29 +7654,24 @@ pub mod tagsummary { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/tagsummary", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6536,12 +7823,50 @@ pub mod workitems { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) test_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + let test_name = &this.test_name; + req.url_mut() + .query_pairs_mut() + .append_pair("testName", test_name); + let req_body = azure_core::Bytes::new(); + req.insert_header(azure_core::http::headers::CONTENT_LENGTH, "0"); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/testmethods/workitems?testName={}", + self.client.endpoint(), + self.organization, + self.project, + self.test_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6551,9 +7876,7 @@ pub mod workitems { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6565,31 +7888,24 @@ pub mod workitems { auth_header, ); } - let test_name = &this.test_name; - req.url_mut() - .query_pairs_mut() - .append_pair("testName", test_name); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testmethods/workitems?testName={}", - self.client.endpoint(), - self.organization, - self.project, - self.test_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6639,8 +7955,12 @@ pub mod workitems { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) work_item_category: String, @@ -6650,7 +7970,7 @@ pub mod workitems { pub(crate) days: Option, pub(crate) work_item_count: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn automated_test_name(mut self, automated_test_name: impl Into) -> Self { self.automated_test_name = Some(automated_test_name.into()); self @@ -6674,6 +7994,66 @@ pub mod workitems { self.work_item_count = Some(work_item_count); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let work_item_category = &this.work_item_category; + req.url_mut() + .query_pairs_mut() + .append_pair("workItemCategory", work_item_category); + if let Some(automated_test_name) = &this.automated_test_name { + req.url_mut() + .query_pairs_mut() + .append_pair("automatedTestName", automated_test_name); + } + if let Some(test_case_id) = &this.test_case_id { + req.url_mut() + .query_pairs_mut() + .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", &formatted_date_time); + } + if let Some(days) = &this.days { + req.url_mut() + .query_pairs_mut() + .append_pair("days", &days.to_string()); + } + if let Some(work_item_count) = &this.work_item_count { + req.url_mut() + .query_pairs_mut() + .append_pair("$workItemCount", &work_item_count.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/results/workitems", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6682,9 +8062,7 @@ pub mod workitems { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6696,56 +8074,24 @@ pub mod workitems { auth_header, ); } - let work_item_category = &this.work_item_category; - req.url_mut() - .query_pairs_mut() - .append_pair("workItemCategory", work_item_category); - if let Some(automated_test_name) = &this.automated_test_name { - req.url_mut() - .query_pairs_mut() - .append_pair("automatedTestName", automated_test_name); - } - if let Some(test_case_id) = &this.test_case_id { - req.url_mut() - .query_pairs_mut() - .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", &formatted_date_time); - } - if let Some(days) = &this.days { - req.url_mut() - .query_pairs_mut() - .append_pair("days", &days.to_string()); - } - if let Some(work_item_count) = &this.work_item_count { - req.url_mut() - .query_pairs_mut() - .append_pair("$workItemCount", &work_item_count.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/results/workitems", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6795,13 +8141,47 @@ pub mod workitems { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_case_result_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/workitems", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6811,9 +8191,7 @@ pub mod workitems { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6825,27 +8203,24 @@ pub mod workitems { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/workitems", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6895,12 +8270,45 @@ pub mod workitems { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemToTestLinks, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/testmethods/workitems", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6910,9 +8318,7 @@ pub mod workitems { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6924,26 +8330,24 @@ pub mod workitems { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testmethods/workitems", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6991,13 +8395,53 @@ pub mod workitems { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) test_name: String, pub(crate) work_item_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let test_name = &this.test_name; + req.url_mut() + .query_pairs_mut() + .append_pair("testName", test_name); + let work_item_id = &this.work_item_id; + req.url_mut() + .query_pairs_mut() + .append_pair("workItemId", &work_item_id.to_string()); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/testmethods/workitems", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7007,9 +8451,7 @@ pub mod workitems { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7021,33 +8463,24 @@ pub mod workitems { auth_header, ); } - let test_name = &this.test_name; - req.url_mut() - .query_pairs_mut() - .append_pair("testName", test_name); - let work_item_id = &this.work_item_id; - req.url_mut() - .query_pairs_mut() - .append_pair("workItemId", &work_item_id.to_string()); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testmethods/workitems", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7124,41 +8557,29 @@ pub mod filecoverage { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::FileCoverageRequest, pub(crate) project: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - 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::http::headers::AUTHORIZATION, - auth_header, - ); - } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -7175,6 +8596,47 @@ pub mod filecoverage { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -7251,15 +8713,19 @@ pub mod status { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) definition: String, pub(crate) branch_name: Option, pub(crate) label: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The branch name."] pub fn branch_name(mut self, branch_name: impl Into) -> Self { self.branch_name = Some(branch_name.into()); @@ -7270,6 +8736,44 @@ pub mod status { self.label = Some(label.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(branch_name) = &this.branch_name { + req.url_mut() + .query_pairs_mut() + .append_pair("branchName", branch_name); + } + if let Some(label) = &this.label { + req.url_mut().query_pairs_mut().append_pair("label", label); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/codecoverage/status/{}", + self.client.endpoint(), + self.organization, + self.project, + self.definition + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7278,9 +8782,7 @@ pub mod status { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7292,34 +8794,24 @@ pub mod status { auth_header, ); } - if let Some(branch_name) = &this.branch_name { - req.url_mut() - .query_pairs_mut() - .append_pair("branchName", branch_name); - } - if let Some(label) = &this.label { - req.url_mut().query_pairs_mut().append_pair("label", label); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/codecoverage/status/{}", - self.client.endpoint(), - self.organization, - self.project, - self.definition - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7403,8 +8895,12 @@ pub mod metrics { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) pipeline_id: i32, @@ -7414,7 +8910,7 @@ pub mod metrics { pub(crate) metric_names: Option, pub(crate) group_by_node: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Name of the stage. Maximum supported length for name is 256 character."] pub fn stage_name(mut self, stage_name: impl Into) -> Self { self.stage_name = Some(stage_name.into()); @@ -7439,6 +8935,64 @@ pub mod metrics { self.group_by_node = Some(group_by_node); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let pipeline_id = &this.pipeline_id; + req.url_mut() + .query_pairs_mut() + .append_pair("pipelineId", &pipeline_id.to_string()); + if let Some(stage_name) = &this.stage_name { + req.url_mut() + .query_pairs_mut() + .append_pair("stageName", stage_name); + } + if let Some(phase_name) = &this.phase_name { + req.url_mut() + .query_pairs_mut() + .append_pair("phaseName", phase_name); + } + if let Some(job_name) = &this.job_name { + req.url_mut() + .query_pairs_mut() + .append_pair("jobName", job_name); + } + if let Some(metric_names) = &this.metric_names { + req.url_mut() + .query_pairs_mut() + .append_pair("metricNames", metric_names); + } + if let Some(group_by_node) = &this.group_by_node { + req.url_mut() + .query_pairs_mut() + .append_pair("groupByNode", &group_by_node.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/metrics", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7447,9 +9001,7 @@ pub mod metrics { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7461,54 +9013,24 @@ pub mod metrics { auth_header, ); } - let pipeline_id = &this.pipeline_id; - req.url_mut() - .query_pairs_mut() - .append_pair("pipelineId", &pipeline_id.to_string()); - if let Some(stage_name) = &this.stage_name { - req.url_mut() - .query_pairs_mut() - .append_pair("stageName", stage_name); - } - if let Some(phase_name) = &this.phase_name { - req.url_mut() - .query_pairs_mut() - .append_pair("phaseName", phase_name); - } - if let Some(job_name) = &this.job_name { - req.url_mut() - .query_pairs_mut() - .append_pair("jobName", job_name); - } - if let Some(metric_names) = &this.metric_names { - req.url_mut() - .query_pairs_mut() - .append_pair("metricNames", metric_names); - } - if let Some(group_by_node) = &this.group_by_node { - req.url_mut() - .query_pairs_mut() - .append_pair("groupByNode", &group_by_node.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/metrics", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7590,8 +9112,12 @@ pub mod resultdetailsbybuild { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, @@ -7602,7 +9128,7 @@ pub mod resultdetailsbybuild { pub(crate) should_include_results: Option, pub(crate) query_run_summary_for_in_progress: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn publish_context(mut self, publish_context: impl Into) -> Self { self.publish_context = Some(publish_context.into()); self @@ -7630,6 +9156,72 @@ pub mod resultdetailsbybuild { self.query_run_summary_for_in_progress = Some(query_run_summary_for_in_progress); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let build_id = &this.build_id; + req.url_mut() + .query_pairs_mut() + .append_pair("buildId", &build_id.to_string()); + if let Some(publish_context) = &this.publish_context { + req.url_mut() + .query_pairs_mut() + .append_pair("publishContext", publish_context); + } + if let Some(group_by) = &this.group_by { + req.url_mut() + .query_pairs_mut() + .append_pair("groupBy", group_by); + } + if let Some(filter) = &this.filter { + req.url_mut() + .query_pairs_mut() + .append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut() + .query_pairs_mut() + .append_pair("$orderby", orderby); + } + if let Some(should_include_results) = &this.should_include_results { + req.url_mut() + .query_pairs_mut() + .append_pair("shouldIncludeResults", &should_include_results.to_string()); + } + if let Some(query_run_summary_for_in_progress) = + &this.query_run_summary_for_in_progress + { + req.url_mut().query_pairs_mut().append_pair( + "queryRunSummaryForInProgress", + &query_run_summary_for_in_progress.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resultdetailsbybuild", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7638,9 +9230,7 @@ pub mod resultdetailsbybuild { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7652,63 +9242,24 @@ pub mod resultdetailsbybuild { auth_header, ); } - let build_id = &this.build_id; - req.url_mut() - .query_pairs_mut() - .append_pair("buildId", &build_id.to_string()); - if let Some(publish_context) = &this.publish_context { - req.url_mut() - .query_pairs_mut() - .append_pair("publishContext", publish_context); - } - if let Some(group_by) = &this.group_by { - req.url_mut() - .query_pairs_mut() - .append_pair("groupBy", group_by); - } - if let Some(filter) = &this.filter { - req.url_mut() - .query_pairs_mut() - .append_pair("$filter", filter); - } - if let Some(orderby) = &this.orderby { - req.url_mut() - .query_pairs_mut() - .append_pair("$orderby", orderby); - } - if let Some(should_include_results) = &this.should_include_results { - req.url_mut().query_pairs_mut().append_pair( - "shouldIncludeResults", - &should_include_results.to_string(), - ); - } - if let Some(query_run_summary_for_in_progress) = - &this.query_run_summary_for_in_progress - { - req.url_mut().query_pairs_mut().append_pair( - "queryRunSummaryForInProgress", - &query_run_summary_for_in_progress.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resultdetailsbybuild", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7792,8 +9343,12 @@ pub mod resultdetailsbyrelease { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, @@ -7805,7 +9360,7 @@ pub mod resultdetailsbyrelease { pub(crate) should_include_results: Option, pub(crate) query_run_summary_for_in_progress: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn publish_context(mut self, publish_context: impl Into) -> Self { self.publish_context = Some(publish_context.into()); self @@ -7833,6 +9388,76 @@ pub mod resultdetailsbyrelease { self.query_run_summary_for_in_progress = Some(query_run_summary_for_in_progress); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let release_id = &this.release_id; + req.url_mut() + .query_pairs_mut() + .append_pair("releaseId", &release_id.to_string()); + let release_env_id = &this.release_env_id; + req.url_mut() + .query_pairs_mut() + .append_pair("releaseEnvId", &release_env_id.to_string()); + if let Some(publish_context) = &this.publish_context { + req.url_mut() + .query_pairs_mut() + .append_pair("publishContext", publish_context); + } + if let Some(group_by) = &this.group_by { + req.url_mut() + .query_pairs_mut() + .append_pair("groupBy", group_by); + } + if let Some(filter) = &this.filter { + req.url_mut() + .query_pairs_mut() + .append_pair("$filter", filter); + } + if let Some(orderby) = &this.orderby { + req.url_mut() + .query_pairs_mut() + .append_pair("$orderby", orderby); + } + if let Some(should_include_results) = &this.should_include_results { + req.url_mut() + .query_pairs_mut() + .append_pair("shouldIncludeResults", &should_include_results.to_string()); + } + if let Some(query_run_summary_for_in_progress) = + &this.query_run_summary_for_in_progress + { + req.url_mut().query_pairs_mut().append_pair( + "queryRunSummaryForInProgress", + &query_run_summary_for_in_progress.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resultdetailsbyrelease", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7841,9 +9466,7 @@ pub mod resultdetailsbyrelease { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7855,67 +9478,24 @@ pub mod resultdetailsbyrelease { auth_header, ); } - let release_id = &this.release_id; - req.url_mut() - .query_pairs_mut() - .append_pair("releaseId", &release_id.to_string()); - let release_env_id = &this.release_env_id; - req.url_mut() - .query_pairs_mut() - .append_pair("releaseEnvId", &release_env_id.to_string()); - if let Some(publish_context) = &this.publish_context { - req.url_mut() - .query_pairs_mut() - .append_pair("publishContext", publish_context); - } - if let Some(group_by) = &this.group_by { - req.url_mut() - .query_pairs_mut() - .append_pair("groupBy", group_by); - } - if let Some(filter) = &this.filter { - req.url_mut() - .query_pairs_mut() - .append_pair("$filter", filter); - } - if let Some(orderby) = &this.orderby { - req.url_mut() - .query_pairs_mut() - .append_pair("$orderby", orderby); - } - if let Some(should_include_results) = &this.should_include_results { - req.url_mut().query_pairs_mut().append_pair( - "shouldIncludeResults", - &should_include_results.to_string(), - ); - } - if let Some(query_run_summary_for_in_progress) = - &this.query_run_summary_for_in_progress - { - req.url_mut().query_pairs_mut().append_pair( - "queryRunSummaryForInProgress", - &query_run_summary_for_in_progress.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resultdetailsbyrelease", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7998,8 +9578,12 @@ pub mod resultgroupsbybuild { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, @@ -8007,7 +9591,7 @@ pub mod resultgroupsbybuild { pub(crate) fields: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn fields(mut self, fields: impl Into) -> Self { self.fields = Some(fields.into()); self @@ -8016,6 +9600,53 @@ pub mod resultgroupsbybuild { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let build_id = &this.build_id; + req.url_mut() + .query_pairs_mut() + .append_pair("buildId", &build_id.to_string()); + let publish_context = &this.publish_context; + req.url_mut() + .query_pairs_mut() + .append_pair("publishContext", publish_context); + if let Some(fields) = &this.fields { + req.url_mut() + .query_pairs_mut() + .append_pair("fields", fields); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resultgroupsbybuild", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8024,9 +9655,7 @@ pub mod resultgroupsbybuild { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8038,43 +9667,24 @@ pub mod resultgroupsbybuild { auth_header, ); } - let build_id = &this.build_id; - req.url_mut() - .query_pairs_mut() - .append_pair("buildId", &build_id.to_string()); - let publish_context = &this.publish_context; - req.url_mut() - .query_pairs_mut() - .append_pair("publishContext", publish_context); - if let Some(fields) = &this.fields { - req.url_mut() - .query_pairs_mut() - .append_pair("fields", fields); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resultgroupsbybuild", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8159,8 +9769,12 @@ pub mod resultgroupsbyrelease { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, @@ -8169,7 +9783,7 @@ pub mod resultgroupsbyrelease { pub(crate) fields: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn release_env_id(mut self, release_env_id: i32) -> Self { self.release_env_id = Some(release_env_id); self @@ -8182,6 +9796,58 @@ pub mod resultgroupsbyrelease { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let release_id = &this.release_id; + req.url_mut() + .query_pairs_mut() + .append_pair("releaseId", &release_id.to_string()); + let publish_context = &this.publish_context; + req.url_mut() + .query_pairs_mut() + .append_pair("publishContext", publish_context); + if let Some(release_env_id) = &this.release_env_id { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseEnvId", &release_env_id.to_string()); + } + if let Some(fields) = &this.fields { + req.url_mut() + .query_pairs_mut() + .append_pair("fields", fields); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resultgroupsbyrelease", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8190,9 +9856,7 @@ pub mod resultgroupsbyrelease { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8204,48 +9868,24 @@ pub mod resultgroupsbyrelease { auth_header, ); } - let release_id = &this.release_id; - req.url_mut() - .query_pairs_mut() - .append_pair("releaseId", &release_id.to_string()); - let publish_context = &this.publish_context; - req.url_mut() - .query_pairs_mut() - .append_pair("publishContext", publish_context); - if let Some(release_env_id) = &this.release_env_id { - req.url_mut() - .query_pairs_mut() - .append_pair("releaseEnvId", &release_env_id.to_string()); - } - if let Some(fields) = &this.fields { - req.url_mut() - .query_pairs_mut() - .append_pair("fields", fields); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resultgroupsbyrelease", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8418,12 +10058,45 @@ pub mod results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestResultsQuery, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/results", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8433,9 +10106,7 @@ pub mod results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8447,26 +10118,24 @@ pub mod results { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/results", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8516,8 +10185,12 @@ pub mod results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::QueryModel, pub(crate) project: String, @@ -8526,7 +10199,7 @@ pub mod results { pub(crate) skip: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn include_result_details(mut self, include_result_details: bool) -> Self { self.include_result_details = Some(include_result_details); self @@ -8543,6 +10216,57 @@ pub mod results { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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", &include_result_details.to_string()); + } + if let Some(include_iteration_details) = &this.include_iteration_details { + req.url_mut().query_pairs_mut().append_pair( + "includeIterationDetails", + &include_iteration_details.to_string(), + ); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/results/query", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8551,9 +10275,7 @@ pub mod results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8565,48 +10287,24 @@ pub mod results { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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", - &include_result_details.to_string(), - ); - } - if let Some(include_iteration_details) = &this.include_iteration_details { - req.url_mut().query_pairs_mut().append_pair( - "includeIterationDetails", - &include_iteration_details.to_string(), - ); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/results/query", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8656,8 +10354,12 @@ pub mod results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -8667,7 +10369,7 @@ pub mod results { pub(crate) outcomes: Option, pub(crate) new_tests_only: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn details_to_include( mut self, details_to_include: impl Into, @@ -8691,6 +10393,61 @@ pub mod results { self.new_tests_only = Some(new_tests_only); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(details_to_include) = &this.details_to_include { + req.url_mut() + .query_pairs_mut() + .append_pair("detailsToInclude", &details_to_include.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(outcomes) = &this.outcomes { + req.url_mut() + .query_pairs_mut() + .append_pair("outcomes", outcomes); + } + if let Some(new_tests_only) = &this.new_tests_only { + req.url_mut() + .query_pairs_mut() + .append_pair("$newTestsOnly", &new_tests_only.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8699,9 +10456,7 @@ pub mod results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8713,51 +10468,24 @@ pub mod results { auth_header, ); } - if let Some(details_to_include) = &this.details_to_include { - req.url_mut() - .query_pairs_mut() - .append_pair("detailsToInclude", &details_to_include.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(outcomes) = &this.outcomes { - req.url_mut() - .query_pairs_mut() - .append_pair("outcomes", outcomes); - } - if let Some(new_tests_only) = &this.new_tests_only { - req.url_mut() - .query_pairs_mut() - .append_pair("$newTestsOnly", &new_tests_only.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8807,13 +10535,47 @@ pub mod results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8823,9 +10585,7 @@ pub mod results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8837,27 +10597,24 @@ pub mod results { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8907,13 +10664,47 @@ pub mod results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8923,9 +10714,7 @@ pub mod results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8937,27 +10726,24 @@ pub mod results { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9007,15 +10793,19 @@ pub mod results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_result_id: i32, pub(crate) details_to_include: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn details_to_include( mut self, details_to_include: impl Into, @@ -9023,6 +10813,42 @@ pub mod results { self.details_to_include = Some(details_to_include.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(details_to_include) = &this.details_to_include { + req.url_mut() + .query_pairs_mut() + .append_pair("detailsToInclude", &details_to_include.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -9031,9 +10857,7 @@ pub mod results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9045,32 +10869,24 @@ pub mod results { auth_header, ); } - if let Some(details_to_include) = &this.details_to_include { - req.url_mut() - .query_pairs_mut() - .append_pair("detailsToInclude", &details_to_include.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9146,12 +10962,45 @@ pub mod history { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ResultsFilter, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/results/history", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9161,9 +11010,7 @@ pub mod history { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9175,26 +11022,24 @@ pub mod history { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/results/history", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9299,14 +11144,18 @@ pub mod result_meta_data { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) details_to_include: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Details to include with test results metadata. Default is None. Other values are FlakyIdentifiers."] pub fn details_to_include( mut self, @@ -9315,6 +11164,41 @@ pub mod result_meta_data { self.details_to_include = Some(details_to_include.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/results/resultmetadata", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -9323,9 +11207,7 @@ pub mod result_meta_data { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9337,31 +11219,24 @@ pub mod result_meta_data { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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.to_string()); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/results/resultmetadata", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9412,13 +11287,47 @@ pub mod result_meta_data { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestResultMetaDataUpdateInput, pub(crate) project: String, pub(crate) test_case_reference_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/results/resultmetadata/{}", + self.client.endpoint(), + self.organization, + self.project, + self.test_case_reference_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9428,9 +11337,7 @@ pub mod result_meta_data { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9442,27 +11349,24 @@ pub mod result_meta_data { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/results/resultmetadata/{}", - self.client.endpoint(), - self.organization, - self.project, - self.test_case_reference_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9541,12 +11445,45 @@ pub mod test_history { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestHistoryQuery, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/results/testhistory", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9556,9 +11493,7 @@ pub mod test_history { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9570,26 +11505,24 @@ pub mod test_history { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/results/testhistory", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9672,8 +11605,12 @@ pub mod resultsbybuild { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, @@ -9682,7 +11619,7 @@ pub mod resultsbybuild { pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn publish_context(mut self, publish_context: impl Into) -> Self { self.publish_context = Some(publish_context.into()); self @@ -9699,6 +11636,59 @@ pub mod resultsbybuild { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let build_id = &this.build_id; + req.url_mut() + .query_pairs_mut() + .append_pair("buildId", &build_id.to_string()); + if let Some(publish_context) = &this.publish_context { + req.url_mut() + .query_pairs_mut() + .append_pair("publishContext", publish_context); + } + if let Some(outcomes) = &this.outcomes { + req.url_mut() + .query_pairs_mut() + .append_pair("outcomes", outcomes); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resultsbybuild", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -9707,9 +11697,7 @@ pub mod resultsbybuild { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9721,49 +11709,24 @@ pub mod resultsbybuild { auth_header, ); } - let build_id = &this.build_id; - req.url_mut() - .query_pairs_mut() - .append_pair("buildId", &build_id.to_string()); - if let Some(publish_context) = &this.publish_context { - req.url_mut() - .query_pairs_mut() - .append_pair("publishContext", publish_context); - } - if let Some(outcomes) = &this.outcomes { - req.url_mut() - .query_pairs_mut() - .append_pair("outcomes", outcomes); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resultsbybuild", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9852,8 +11815,12 @@ pub mod resultsbypipeline { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) pipeline_id: i32, @@ -9864,7 +11831,7 @@ pub mod resultsbypipeline { pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Name of the stage. Maximum supported length for name is 256 character."] pub fn stage_name(mut self, stage_name: impl Into) -> Self { self.stage_name = Some(stage_name.into()); @@ -9895,6 +11862,67 @@ pub mod resultsbypipeline { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let pipeline_id = &this.pipeline_id; + req.url_mut() + .query_pairs_mut() + .append_pair("pipelineId", &pipeline_id.to_string()); + if let Some(stage_name) = &this.stage_name { + req.url_mut() + .query_pairs_mut() + .append_pair("stageName", stage_name); + } + if let Some(phase_name) = &this.phase_name { + req.url_mut() + .query_pairs_mut() + .append_pair("phaseName", phase_name); + } + if let Some(job_name) = &this.job_name { + req.url_mut() + .query_pairs_mut() + .append_pair("jobName", job_name); + } + if let Some(outcomes) = &this.outcomes { + req.url_mut() + .query_pairs_mut() + .append_pair("outcomes", outcomes); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.insert_header("continuationtoken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resultsbypipeline", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -9903,9 +11931,7 @@ pub mod resultsbypipeline { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9917,57 +11943,24 @@ pub mod resultsbypipeline { auth_header, ); } - let pipeline_id = &this.pipeline_id; - req.url_mut() - .query_pairs_mut() - .append_pair("pipelineId", &pipeline_id.to_string()); - if let Some(stage_name) = &this.stage_name { - req.url_mut() - .query_pairs_mut() - .append_pair("stageName", stage_name); - } - if let Some(phase_name) = &this.phase_name { - req.url_mut() - .query_pairs_mut() - .append_pair("phaseName", phase_name); - } - if let Some(job_name) = &this.job_name { - req.url_mut() - .query_pairs_mut() - .append_pair("jobName", job_name); - } - if let Some(outcomes) = &this.outcomes { - req.url_mut() - .query_pairs_mut() - .append_pair("outcomes", outcomes); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.insert_header("continuationtoken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resultsbypipeline", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10052,8 +12045,12 @@ pub mod resultsbyrelease { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, @@ -10063,7 +12060,7 @@ pub mod resultsbyrelease { pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn release_envid(mut self, release_envid: i32) -> Self { self.release_envid = Some(release_envid); self @@ -10084,6 +12081,64 @@ pub mod resultsbyrelease { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let release_id = &this.release_id; + req.url_mut() + .query_pairs_mut() + .append_pair("releaseId", &release_id.to_string()); + if let Some(release_envid) = &this.release_envid { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseEnvid", &release_envid.to_string()); + } + if let Some(publish_context) = &this.publish_context { + req.url_mut() + .query_pairs_mut() + .append_pair("publishContext", publish_context); + } + if let Some(outcomes) = &this.outcomes { + req.url_mut() + .query_pairs_mut() + .append_pair("outcomes", outcomes); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resultsbyrelease", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -10092,9 +12147,7 @@ pub mod resultsbyrelease { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10106,54 +12159,24 @@ pub mod resultsbyrelease { auth_header, ); } - let release_id = &this.release_id; - req.url_mut() - .query_pairs_mut() - .append_pair("releaseId", &release_id.to_string()); - if let Some(release_envid) = &this.release_envid { - req.url_mut() - .query_pairs_mut() - .append_pair("releaseEnvid", &release_envid.to_string()); - } - if let Some(publish_context) = &this.publish_context { - req.url_mut() - .query_pairs_mut() - .append_pair("publishContext", publish_context); - } - if let Some(outcomes) = &this.outcomes { - req.url_mut() - .query_pairs_mut() - .append_pair("outcomes", outcomes); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resultsbyrelease", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10238,8 +12261,12 @@ pub mod resultsgroup_details { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) pipeline_id: i32, @@ -10249,7 +12276,7 @@ pub mod resultsgroup_details { pub(crate) should_include_failed_and_aborted_results: Option, pub(crate) query_group_summary_for_in_progress: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Name of the stage. Maximum supported length for name is 256 character."] pub fn stage_name(mut self, stage_name: impl Into) -> Self { self.stage_name = Some(stage_name.into()); @@ -10283,6 +12310,70 @@ pub mod resultsgroup_details { Some(query_group_summary_for_in_progress); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let pipeline_id = &this.pipeline_id; + req.url_mut() + .query_pairs_mut() + .append_pair("pipelineId", &pipeline_id.to_string()); + if let Some(stage_name) = &this.stage_name { + req.url_mut() + .query_pairs_mut() + .append_pair("stageName", stage_name); + } + if let Some(phase_name) = &this.phase_name { + req.url_mut() + .query_pairs_mut() + .append_pair("phaseName", phase_name); + } + if let Some(job_name) = &this.job_name { + req.url_mut() + .query_pairs_mut() + .append_pair("jobName", job_name); + } + if let Some(should_include_failed_and_aborted_results) = + &this.should_include_failed_and_aborted_results + { + req.url_mut().query_pairs_mut().append_pair( + "shouldIncludeFailedAndAbortedResults", + &should_include_failed_and_aborted_results.to_string(), + ); + } + if let Some(query_group_summary_for_in_progress) = + &this.query_group_summary_for_in_progress + { + req.url_mut().query_pairs_mut().append_pair( + "queryGroupSummaryForInProgress", + &query_group_summary_for_in_progress.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resultsgroupdetails", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -10291,9 +12382,7 @@ pub mod resultsgroup_details { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10305,60 +12394,24 @@ pub mod resultsgroup_details { auth_header, ); } - let pipeline_id = &this.pipeline_id; - req.url_mut() - .query_pairs_mut() - .append_pair("pipelineId", &pipeline_id.to_string()); - if let Some(stage_name) = &this.stage_name { - req.url_mut() - .query_pairs_mut() - .append_pair("stageName", stage_name); - } - if let Some(phase_name) = &this.phase_name { - req.url_mut() - .query_pairs_mut() - .append_pair("phaseName", phase_name); - } - if let Some(job_name) = &this.job_name { - req.url_mut() - .query_pairs_mut() - .append_pair("jobName", job_name); - } - if let Some(should_include_failed_and_aborted_results) = - &this.should_include_failed_and_aborted_results - { - req.url_mut().query_pairs_mut().append_pair( - "shouldIncludeFailedAndAbortedResults", - &should_include_failed_and_aborted_results.to_string(), - ); - } - if let Some(query_group_summary_for_in_progress) = - &this.query_group_summary_for_in_progress - { - req.url_mut().query_pairs_mut().append_pair( - "queryGroupSummaryForInProgress", - &query_group_summary_for_in_progress.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resultsgroupdetails", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10443,8 +12496,12 @@ pub mod resultsummarybybuild { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) build_id: i32, @@ -10458,7 +12515,7 @@ pub mod resultsummarybybuild { pub(crate) build_to_compare_repository_id: Option, pub(crate) build_to_compare_uri: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn publish_context(mut self, publish_context: impl Into) -> Self { self.publish_context = Some(publish_context.into()); self @@ -10517,6 +12574,87 @@ pub mod resultsummarybybuild { self.build_to_compare_uri = Some(build_to_compare_uri.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let build_id = &this.build_id; + req.url_mut() + .query_pairs_mut() + .append_pair("buildId", &build_id.to_string()); + if let Some(publish_context) = &this.publish_context { + req.url_mut() + .query_pairs_mut() + .append_pair("publishContext", publish_context); + } + if let Some(include_failure_details) = &this.include_failure_details { + req.url_mut().query_pairs_mut().append_pair( + "includeFailureDetails", + &include_failure_details.to_string(), + ); + } + if let Some(build_to_compare_branch_name) = &this.build_to_compare_branch_name { + req.url_mut() + .query_pairs_mut() + .append_pair("buildToCompare.branchName", build_to_compare_branch_name); + } + if let Some(build_to_compare_build_system) = &this.build_to_compare_build_system { + req.url_mut() + .query_pairs_mut() + .append_pair("buildToCompare.buildSystem", build_to_compare_build_system); + } + if let Some(build_to_compare_definition_id) = &this.build_to_compare_definition_id { + req.url_mut().query_pairs_mut().append_pair( + "buildToCompare.definitionId", + &build_to_compare_definition_id.to_string(), + ); + } + if let Some(build_to_compare_id) = &this.build_to_compare_id { + req.url_mut() + .query_pairs_mut() + .append_pair("buildToCompare.id", &build_to_compare_id.to_string()); + } + if let Some(build_to_compare_number) = &this.build_to_compare_number { + req.url_mut() + .query_pairs_mut() + .append_pair("buildToCompare.number", build_to_compare_number); + } + if let Some(build_to_compare_repository_id) = &this.build_to_compare_repository_id { + req.url_mut().query_pairs_mut().append_pair( + "buildToCompare.repositoryId", + build_to_compare_repository_id, + ); + } + if let Some(build_to_compare_uri) = &this.build_to_compare_uri { + req.url_mut() + .query_pairs_mut() + .append_pair("buildToCompare.uri", build_to_compare_uri); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resultsummarybybuild", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -10525,9 +12663,7 @@ pub mod resultsummarybybuild { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10539,87 +12675,24 @@ pub mod resultsummarybybuild { auth_header, ); } - let build_id = &this.build_id; - req.url_mut() - .query_pairs_mut() - .append_pair("buildId", &build_id.to_string()); - if let Some(publish_context) = &this.publish_context { - req.url_mut() - .query_pairs_mut() - .append_pair("publishContext", publish_context); - } - if let Some(include_failure_details) = &this.include_failure_details { - req.url_mut().query_pairs_mut().append_pair( - "includeFailureDetails", - &include_failure_details.to_string(), - ); - } - if let Some(build_to_compare_branch_name) = - &this.build_to_compare_branch_name - { - req.url_mut().query_pairs_mut().append_pair( - "buildToCompare.branchName", - build_to_compare_branch_name, - ); - } - if let Some(build_to_compare_build_system) = - &this.build_to_compare_build_system - { - req.url_mut().query_pairs_mut().append_pair( - "buildToCompare.buildSystem", - build_to_compare_build_system, - ); - } - if let Some(build_to_compare_definition_id) = - &this.build_to_compare_definition_id - { - req.url_mut().query_pairs_mut().append_pair( - "buildToCompare.definitionId", - &build_to_compare_definition_id.to_string(), - ); - } - if let Some(build_to_compare_id) = &this.build_to_compare_id { - req.url_mut() - .query_pairs_mut() - .append_pair("buildToCompare.id", &build_to_compare_id.to_string()); - } - if let Some(build_to_compare_number) = &this.build_to_compare_number { - req.url_mut() - .query_pairs_mut() - .append_pair("buildToCompare.number", build_to_compare_number); - } - if let Some(build_to_compare_repository_id) = - &this.build_to_compare_repository_id - { - req.url_mut().query_pairs_mut().append_pair( - "buildToCompare.repositoryId", - build_to_compare_repository_id, - ); - } - if let Some(build_to_compare_uri) = &this.build_to_compare_uri { - req.url_mut() - .query_pairs_mut() - .append_pair("buildToCompare.uri", build_to_compare_uri); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resultsummarybybuild", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10702,8 +12775,12 @@ pub mod resultsummarybypipeline { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) pipeline_id: i32, @@ -10712,7 +12789,7 @@ pub mod resultsummarybypipeline { pub(crate) job_name: Option, pub(crate) include_failure_details: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Name of the stage. Maximum supported length for name is 256 character."] pub fn stage_name(mut self, stage_name: impl Into) -> Self { self.stage_name = Some(stage_name.into()); @@ -10733,6 +12810,60 @@ pub mod resultsummarybypipeline { self.include_failure_details = Some(include_failure_details); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let pipeline_id = &this.pipeline_id; + req.url_mut() + .query_pairs_mut() + .append_pair("pipelineId", &pipeline_id.to_string()); + if let Some(stage_name) = &this.stage_name { + req.url_mut() + .query_pairs_mut() + .append_pair("stageName", stage_name); + } + if let Some(phase_name) = &this.phase_name { + req.url_mut() + .query_pairs_mut() + .append_pair("phaseName", phase_name); + } + if let Some(job_name) = &this.job_name { + req.url_mut() + .query_pairs_mut() + .append_pair("jobName", job_name); + } + if let Some(include_failure_details) = &this.include_failure_details { + req.url_mut().query_pairs_mut().append_pair( + "includeFailureDetails", + &include_failure_details.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resultsummarybypipeline", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -10741,9 +12872,7 @@ pub mod resultsummarybypipeline { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10755,50 +12884,24 @@ pub mod resultsummarybypipeline { auth_header, ); } - let pipeline_id = &this.pipeline_id; - req.url_mut() - .query_pairs_mut() - .append_pair("pipelineId", &pipeline_id.to_string()); - if let Some(stage_name) = &this.stage_name { - req.url_mut() - .query_pairs_mut() - .append_pair("stageName", stage_name); - } - if let Some(phase_name) = &this.phase_name { - req.url_mut() - .query_pairs_mut() - .append_pair("phaseName", phase_name); - } - if let Some(job_name) = &this.job_name { - req.url_mut() - .query_pairs_mut() - .append_pair("jobName", job_name); - } - if let Some(include_failure_details) = &this.include_failure_details { - req.url_mut().query_pairs_mut().append_pair( - "includeFailureDetails", - &include_failure_details.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resultsummarybypipeline", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10904,8 +13007,12 @@ pub mod resultsummarybyrelease { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) release_id: i32, @@ -10923,7 +13030,7 @@ pub mod resultsummarybyrelease { pub(crate) release_to_compare_id: Option, pub(crate) release_to_compare_name: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn publish_context(mut self, publish_context: impl Into) -> Self { self.publish_context = Some(publish_context.into()); self @@ -11011,6 +13118,130 @@ pub mod resultsummarybyrelease { self.release_to_compare_name = Some(release_to_compare_name.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let release_id = &this.release_id; + req.url_mut() + .query_pairs_mut() + .append_pair("releaseId", &release_id.to_string()); + let release_env_id = &this.release_env_id; + req.url_mut() + .query_pairs_mut() + .append_pair("releaseEnvId", &release_env_id.to_string()); + if let Some(publish_context) = &this.publish_context { + req.url_mut() + .query_pairs_mut() + .append_pair("publishContext", publish_context); + } + if let Some(include_failure_details) = &this.include_failure_details { + req.url_mut().query_pairs_mut().append_pair( + "includeFailureDetails", + &include_failure_details.to_string(), + ); + } + if let Some(release_to_compare_attempt) = &this.release_to_compare_attempt { + req.url_mut().query_pairs_mut().append_pair( + "releaseToCompare.attempt", + &release_to_compare_attempt.to_string(), + ); + } + if let Some(release_to_compare_creation_date) = + &this.release_to_compare_creation_date + { + 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 + { + req.url_mut().query_pairs_mut().append_pair( + "releaseToCompare.definitionId", + &release_to_compare_definition_id.to_string(), + ); + } + 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", + &formatted_date_time, + ); + } + if let Some(release_to_compare_environment_definition_id) = + &this.release_to_compare_environment_definition_id + { + req.url_mut().query_pairs_mut().append_pair( + "releaseToCompare.environmentDefinitionId", + &release_to_compare_environment_definition_id.to_string(), + ); + } + if let Some(release_to_compare_environment_definition_name) = + &this.release_to_compare_environment_definition_name + { + req.url_mut().query_pairs_mut().append_pair( + "releaseToCompare.environmentDefinitionName", + release_to_compare_environment_definition_name, + ); + } + if let Some(release_to_compare_environment_id) = + &this.release_to_compare_environment_id + { + req.url_mut().query_pairs_mut().append_pair( + "releaseToCompare.environmentId", + &release_to_compare_environment_id.to_string(), + ); + } + if let Some(release_to_compare_environment_name) = + &this.release_to_compare_environment_name + { + req.url_mut().query_pairs_mut().append_pair( + "releaseToCompare.environmentName", + release_to_compare_environment_name, + ); + } + if let Some(release_to_compare_id) = &this.release_to_compare_id { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseToCompare.id", &release_to_compare_id.to_string()); + } + if let Some(release_to_compare_name) = &this.release_to_compare_name { + req.url_mut() + .query_pairs_mut() + .append_pair("releaseToCompare.name", release_to_compare_name); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resultsummarybyrelease", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -11019,9 +13250,7 @@ pub mod resultsummarybyrelease { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11033,122 +13262,24 @@ pub mod resultsummarybyrelease { auth_header, ); } - let release_id = &this.release_id; - req.url_mut() - .query_pairs_mut() - .append_pair("releaseId", &release_id.to_string()); - let release_env_id = &this.release_env_id; - req.url_mut() - .query_pairs_mut() - .append_pair("releaseEnvId", &release_env_id.to_string()); - if let Some(publish_context) = &this.publish_context { - req.url_mut() - .query_pairs_mut() - .append_pair("publishContext", publish_context); - } - if let Some(include_failure_details) = &this.include_failure_details { - req.url_mut().query_pairs_mut().append_pair( - "includeFailureDetails", - &include_failure_details.to_string(), - ); - } - if let Some(release_to_compare_attempt) = &this.release_to_compare_attempt { - req.url_mut().query_pairs_mut().append_pair( - "releaseToCompare.attempt", - &release_to_compare_attempt.to_string(), - ); - } - if let Some(release_to_compare_creation_date) = - &this.release_to_compare_creation_date - { - 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 - { - req.url_mut().query_pairs_mut().append_pair( - "releaseToCompare.definitionId", - &release_to_compare_definition_id.to_string(), - ); - } - 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", - &formatted_date_time, - ); - } - if let Some(release_to_compare_environment_definition_id) = - &this.release_to_compare_environment_definition_id - { - req.url_mut().query_pairs_mut().append_pair( - "releaseToCompare.environmentDefinitionId", - &release_to_compare_environment_definition_id.to_string(), - ); - } - if let Some(release_to_compare_environment_definition_name) = - &this.release_to_compare_environment_definition_name - { - req.url_mut().query_pairs_mut().append_pair( - "releaseToCompare.environmentDefinitionName", - release_to_compare_environment_definition_name, - ); - } - if let Some(release_to_compare_environment_id) = - &this.release_to_compare_environment_id - { - req.url_mut().query_pairs_mut().append_pair( - "releaseToCompare.environmentId", - &release_to_compare_environment_id.to_string(), - ); - } - if let Some(release_to_compare_environment_name) = - &this.release_to_compare_environment_name - { - req.url_mut().query_pairs_mut().append_pair( - "releaseToCompare.environmentName", - release_to_compare_environment_name, - ); - } - if let Some(release_to_compare_id) = &this.release_to_compare_id { - req.url_mut().query_pairs_mut().append_pair( - "releaseToCompare.id", - &release_to_compare_id.to_string(), - ); - } - if let Some(release_to_compare_name) = &this.release_to_compare_name { - req.url_mut() - .query_pairs_mut() - .append_pair("releaseToCompare.name", release_to_compare_name); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resultsummarybyrelease", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11198,12 +13329,45 @@ pub mod resultsummarybyrelease { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resultsummarybyrelease", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11213,9 +13377,7 @@ pub mod resultsummarybyrelease { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11227,26 +13389,24 @@ pub mod resultsummarybyrelease { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resultsummarybyrelease", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11326,18 +13486,57 @@ pub mod resultsummarybyrequirement { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestResultsContext, pub(crate) project: String, pub(crate) work_item_ids: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn work_item_ids(mut self, work_item_ids: impl Into) -> Self { self.work_item_ids = Some(work_item_ids.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resultsummarybyrequirement", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -11346,9 +13545,7 @@ pub mod resultsummarybyrequirement { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11360,31 +13557,24 @@ pub mod resultsummarybyrequirement { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resultsummarybyrequirement", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11464,12 +13654,45 @@ pub mod result_trend_by_build { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestResultTrendFilter, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resulttrendbybuild", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11479,9 +13702,7 @@ pub mod result_trend_by_build { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11493,26 +13714,24 @@ pub mod result_trend_by_build { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resulttrendbybuild", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11592,12 +13811,45 @@ pub mod result_trend_by_release { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestResultTrendFilter, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/resulttrendbyrelease", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11607,9 +13859,7 @@ pub mod result_trend_by_release { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11621,26 +13871,24 @@ pub mod result_trend_by_release { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/resulttrendbyrelease", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11723,12 +13971,45 @@ pub mod message_logs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/messagelogs", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11738,9 +14019,7 @@ pub mod message_logs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11752,26 +14031,24 @@ pub mod message_logs { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/messagelogs", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11850,13 +14127,47 @@ pub mod result_document { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestResultDocument, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/resultdocument", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11866,9 +14177,7 @@ pub mod result_document { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11880,27 +14189,24 @@ pub mod result_document { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/resultdocument", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11978,13 +14284,47 @@ pub mod bugs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, pub(crate) test_case_result_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/bugs", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_case_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11994,9 +14334,7 @@ pub mod bugs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12008,27 +14346,24 @@ pub mod bugs { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/bugs", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_case_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12115,8 +14450,12 @@ pub mod similar_test_results { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, @@ -12125,7 +14464,7 @@ pub mod similar_test_results { pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Maximum number of results to return"] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -12136,6 +14475,49 @@ pub mod similar_test_results { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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()); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.insert_header("continuationtoken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/results/{}/similartestresults", + self.client.endpoint(), + self.organization, + self.project, + self.run_id, + self.test_result_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -12144,9 +14526,7 @@ pub mod similar_test_results { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12158,39 +14538,24 @@ pub mod similar_test_results { 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()); - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.insert_header("continuationtoken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/results/{}/similartestresults", - self.client.endpoint(), - self.organization, - self.project, - self.run_id, - self.test_result_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12269,24 +14634,55 @@ pub mod runsummary { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/runsummary", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12298,26 +14694,24 @@ pub mod runsummary { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/runsummary", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12396,12 +14790,45 @@ pub mod statistics { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) run_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/runs/{}/statistics", + self.client.endpoint(), + self.organization, + self.project, + self.run_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -12411,9 +14838,7 @@ pub mod statistics { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12425,26 +14850,24 @@ pub mod statistics { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/runs/{}/statistics", - self.client.endpoint(), - self.organization, - self.project, - self.run_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12539,13 +14962,17 @@ pub mod settings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) settings_type: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn settings_type( mut self, settings_type: impl Into, @@ -12553,6 +14980,40 @@ pub mod settings { self.settings_type = Some(settings_type.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(settings_type) = &this.settings_type { + req.url_mut() + .query_pairs_mut() + .append_pair("settingsType", &settings_type.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/settings", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -12561,9 +15022,7 @@ pub mod settings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12575,30 +15034,24 @@ pub mod settings { auth_header, ); } - if let Some(settings_type) = &this.settings_type { - req.url_mut() - .query_pairs_mut() - .append_pair("settingsType", &settings_type.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/settings", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12648,12 +15101,45 @@ pub mod settings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestResultsUpdateSettings, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/settings", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -12663,9 +15149,7 @@ pub mod settings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12677,26 +15161,24 @@ pub mod settings { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/settings", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12811,11 +15293,43 @@ pub mod testfailuretype { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/testfailuretype", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -12825,9 +15339,7 @@ pub mod testfailuretype { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12839,25 +15351,24 @@ pub mod testfailuretype { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testfailuretype", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -12908,12 +15419,45 @@ pub mod testfailuretype { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestResultFailureTypeRequestModel, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/testfailuretype", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -12923,9 +15467,7 @@ pub mod testfailuretype { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -12937,26 +15479,24 @@ pub mod testfailuretype { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testfailuretype", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -13001,12 +15541,45 @@ pub mod testfailuretype { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) failure_type_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/testfailuretype/{}", + self.client.endpoint(), + self.organization, + self.project, + self.failure_type_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -13016,9 +15589,7 @@ pub mod testfailuretype { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -13030,26 +15601,24 @@ pub mod testfailuretype { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testfailuretype/{}", - self.client.endpoint(), - self.organization, - self.project, - self.failure_type_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -13160,12 +15729,48 @@ pub mod testsettings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) test_settings_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/testsettings", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -13175,9 +15780,7 @@ pub mod testsettings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -13189,29 +15792,24 @@ pub mod testsettings { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testsettings", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -13259,12 +15857,45 @@ pub mod testsettings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TestSettings, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/testsettings", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -13274,9 +15905,7 @@ pub mod testsettings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -13288,26 +15917,24 @@ pub mod testsettings { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testsettings", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -13352,12 +15979,48 @@ pub mod testsettings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) test_settings_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/testresults/testsettings", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -13367,9 +16030,7 @@ pub mod testsettings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -13381,29 +16042,24 @@ pub mod testsettings { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/testresults/testsettings", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -13423,3 +16079,2117 @@ pub mod testsettings { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn attachments_client(&self) -> attachments::Client { + attachments::Client(self.clone()) + } + pub fn bugs_client(&self) -> bugs::Client { + bugs::Client(self.clone()) + } + pub fn codecoverage_client(&self) -> codecoverage::Client { + codecoverage::Client(self.clone()) + } + pub fn filecoverage_client(&self) -> filecoverage::Client { + filecoverage::Client(self.clone()) + } + pub fn history_client(&self) -> history::Client { + history::Client(self.clone()) + } + pub fn message_logs_client(&self) -> message_logs::Client { + message_logs::Client(self.clone()) + } + pub fn metrics_client(&self) -> metrics::Client { + metrics::Client(self.clone()) + } + pub fn result_document_client(&self) -> result_document::Client { + result_document::Client(self.clone()) + } + pub fn result_meta_data_client(&self) -> result_meta_data::Client { + result_meta_data::Client(self.clone()) + } + pub fn result_trend_by_build_client(&self) -> result_trend_by_build::Client { + result_trend_by_build::Client(self.clone()) + } + pub fn result_trend_by_release_client(&self) -> result_trend_by_release::Client { + result_trend_by_release::Client(self.clone()) + } + pub fn resultdetailsbybuild_client(&self) -> resultdetailsbybuild::Client { + resultdetailsbybuild::Client(self.clone()) + } + pub fn resultdetailsbyrelease_client(&self) -> resultdetailsbyrelease::Client { + resultdetailsbyrelease::Client(self.clone()) + } + pub fn resultgroupsbybuild_client(&self) -> resultgroupsbybuild::Client { + resultgroupsbybuild::Client(self.clone()) + } + pub fn resultgroupsbyrelease_client(&self) -> resultgroupsbyrelease::Client { + resultgroupsbyrelease::Client(self.clone()) + } + pub fn results_client(&self) -> results::Client { + results::Client(self.clone()) + } + pub fn resultsbybuild_client(&self) -> resultsbybuild::Client { + resultsbybuild::Client(self.clone()) + } + pub fn resultsbypipeline_client(&self) -> resultsbypipeline::Client { + resultsbypipeline::Client(self.clone()) + } + pub fn resultsbyrelease_client(&self) -> resultsbyrelease::Client { + resultsbyrelease::Client(self.clone()) + } + pub fn resultsgroup_details_client(&self) -> resultsgroup_details::Client { + resultsgroup_details::Client(self.clone()) + } + pub fn resultsummarybybuild_client(&self) -> resultsummarybybuild::Client { + resultsummarybybuild::Client(self.clone()) + } + pub fn resultsummarybypipeline_client(&self) -> resultsummarybypipeline::Client { + resultsummarybypipeline::Client(self.clone()) + } + pub fn resultsummarybyrelease_client(&self) -> resultsummarybyrelease::Client { + resultsummarybyrelease::Client(self.clone()) + } + pub fn resultsummarybyrequirement_client(&self) -> resultsummarybyrequirement::Client { + resultsummarybyrequirement::Client(self.clone()) + } + pub fn runs_client(&self) -> runs::Client { + runs::Client(self.clone()) + } + pub fn runsummary_client(&self) -> runsummary::Client { + runsummary::Client(self.clone()) + } + pub fn settings_client(&self) -> settings::Client { + settings::Client(self.clone()) + } + pub fn similar_test_results_client(&self) -> similar_test_results::Client { + similar_test_results::Client(self.clone()) + } + pub fn statistics_client(&self) -> statistics::Client { + statistics::Client(self.clone()) + } + pub fn status_client(&self) -> status::Client { + status::Client(self.clone()) + } + pub fn tags_client(&self) -> tags::Client { + tags::Client(self.clone()) + } + pub fn tagsummary_client(&self) -> tagsummary::Client { + tagsummary::Client(self.clone()) + } + pub fn test_history_client(&self) -> test_history::Client { + test_history::Client(self.clone()) + } + pub fn testattachments_client(&self) -> testattachments::Client { + testattachments::Client(self.clone()) + } + pub fn testfailuretype_client(&self) -> testfailuretype::Client { + testfailuretype::Client(self.clone()) + } + pub fn testlog_client(&self) -> testlog::Client { + testlog::Client(self.clone()) + } + pub fn testlogstoreendpoint_client(&self) -> testlogstoreendpoint::Client { + testlogstoreendpoint::Client(self.clone()) + } + pub fn testsettings_client(&self) -> testsettings::Client { + testsettings::Client(self.clone()) + } + pub fn workitems_client(&self) -> workitems::Client { + workitems::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod codecoverage { + use super::super::codecoverage::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`get_build_code_coverage`](super::super::codecoverage::Client::get_build_code_coverage) for details of the arguments."] + pub fn get_build_code_coverage( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + flags: i32, + ) -> get_build_code_coverage::RequestBuilder { + get_build_code_coverage::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + flags, + } + } + #[doc = "See [`get`](super::super::codecoverage::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + delta_build_id: None, + } + } + #[doc = "http://(tfsserver):8080/tfs/DefaultCollection/_apis/test/CodeCoverage?buildId=10 Request: Json of code coverage summary"] + #[doc = ""] + #[doc = "See [`update`](super::super::codecoverage::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + body: None, + } + } + #[doc = "See [`get_test_run_code_coverage`](super::super::codecoverage::Client::get_test_run_code_coverage) for details of the arguments."] + pub fn get_test_run_code_coverage( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + flags: i32, + ) -> get_test_run_code_coverage::RequestBuilder { + get_test_run_code_coverage::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + flags, + } + } + } + } + pub mod runs { + use super::super::models; + use super::super::runs::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate."] + #[doc = ""] + #[doc = "See [`query`](super::super::runs::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + project: impl Into, + min_last_updated_date: impl Into, + max_last_updated_date: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + min_last_updated_date: min_last_updated_date.into(), + max_last_updated_date: max_last_updated_date.into(), + state: None, + plan_ids: None, + is_automated: None, + publish_context: None, + build_ids: None, + build_def_ids: None, + branch_name: None, + release_ids: None, + release_def_ids: None, + release_env_ids: None, + release_env_def_ids: None, + run_title: None, + top: None, + continuation_token: None, + } + } + #[doc = "See [`list`](super::super::runs::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_uri: None, + owner: None, + tmi_run_id: None, + plan_id: None, + include_run_details: None, + automated: None, + skip: None, + top: None, + } + } + #[doc = "See [`create`](super::super::runs::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "See [`get`](super::super::runs::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + include_details: None, + include_tags: None, + } + } + #[doc = "See [`update`](super::super::runs::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + run_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + run_id, + } + } + #[doc = "See [`delete`](super::super::runs::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + } + } + } + } + pub mod testlog { + use super::super::models; + use super::super::testlog::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get list of test subresult attachments reference"] + #[doc = ""] + #[doc = "See [`get_test_sub_result_logs`](super::super::testlog::Client::get_test_sub_result_logs) for details of the arguments."] + pub fn get_test_sub_result_logs( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + result_id: i32, + sub_result_id: i32, + type_: impl Into, + ) -> get_test_sub_result_logs::RequestBuilder { + get_test_sub_result_logs::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + result_id, + sub_result_id, + type_: type_.into(), + directory_path: None, + file_name_prefix: None, + fetch_meta_data: None, + top: None, + continuation_token: None, + } + } + #[doc = "Get list of test result attachments reference"] + #[doc = ""] + #[doc = "See [`get_test_result_logs`](super::super::testlog::Client::get_test_result_logs) for details of the arguments."] + pub fn get_test_result_logs( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + result_id: i32, + type_: impl Into, + ) -> get_test_result_logs::RequestBuilder { + get_test_result_logs::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + result_id, + type_: type_.into(), + directory_path: None, + file_name_prefix: None, + fetch_meta_data: None, + top: None, + continuation_token: None, + } + } + #[doc = "Get list of test run attachments reference"] + #[doc = ""] + #[doc = "See [`get_test_run_logs`](super::super::testlog::Client::get_test_run_logs) for details of the arguments."] + pub fn get_test_run_logs( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + type_: impl Into, + ) -> get_test_run_logs::RequestBuilder { + get_test_run_logs::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + type_: type_.into(), + directory_path: None, + file_name_prefix: None, + fetch_meta_data: None, + top: None, + continuation_token: None, + } + } + #[doc = "Get list of build attachments reference"] + #[doc = ""] + #[doc = "See [`get_test_logs_for_build`](super::super::testlog::Client::get_test_logs_for_build) for details of the arguments."] + pub fn get_test_logs_for_build( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + type_: impl Into, + ) -> get_test_logs_for_build::RequestBuilder { + get_test_logs_for_build::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + type_: type_.into(), + directory_path: None, + file_name_prefix: None, + fetch_meta_data: None, + top: None, + continuation_token: None, + } + } + } + } + pub mod testlogstoreendpoint { + use super::super::models; + use super::super::testlogstoreendpoint::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get SAS Uri of a test subresults attachment"] + #[doc = ""] + #[doc = "See [`get_test_log_store_endpoint_details_for_sub_result_log`](super::super::testlogstoreendpoint::Client::get_test_log_store_endpoint_details_for_sub_result_log) for details of the arguments."] + pub fn get_test_log_store_endpoint_details_for_sub_result_log( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + result_id: i32, + sub_result_id: i32, + type_: impl Into, + file_path: impl Into, + ) -> get_test_log_store_endpoint_details_for_sub_result_log::RequestBuilder + { + get_test_log_store_endpoint_details_for_sub_result_log::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + result_id, + sub_result_id, + type_: type_.into(), + file_path: file_path.into(), + } + } + #[doc = "Get SAS Uri of a test results attachment"] + #[doc = ""] + #[doc = "See [`get_test_log_store_endpoint_details_for_result_log`](super::super::testlogstoreendpoint::Client::get_test_log_store_endpoint_details_for_result_log) for details of the arguments."] + pub fn get_test_log_store_endpoint_details_for_result_log( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + result_id: i32, + type_: impl Into, + file_path: impl Into, + ) -> get_test_log_store_endpoint_details_for_result_log::RequestBuilder + { + get_test_log_store_endpoint_details_for_result_log::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + result_id, + type_: type_.into(), + file_path: file_path.into(), + } + } + #[doc = "Create empty file for a result and Get Sas uri for the file"] + #[doc = ""] + #[doc = "See [`test_log_store_endpoint_details_for_result`](super::super::testlogstoreendpoint::Client::test_log_store_endpoint_details_for_result) for details of the arguments."] + pub fn test_log_store_endpoint_details_for_result( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + result_id: i32, + sub_result_id: i32, + file_path: impl Into, + type_: impl Into, + ) -> test_log_store_endpoint_details_for_result::RequestBuilder + { + test_log_store_endpoint_details_for_result::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + result_id, + sub_result_id, + file_path: file_path.into(), + type_: type_.into(), + } + } + #[doc = "Get SAS Uri of a test run attachment"] + #[doc = ""] + #[doc = "See [`get_test_log_store_endpoint_details_for_run_log`](super::super::testlogstoreendpoint::Client::get_test_log_store_endpoint_details_for_run_log) for details of the arguments."] + pub fn get_test_log_store_endpoint_details_for_run_log( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + type_: impl Into, + file_path: impl Into, + ) -> get_test_log_store_endpoint_details_for_run_log::RequestBuilder + { + get_test_log_store_endpoint_details_for_run_log::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + type_: type_.into(), + file_path: file_path.into(), + } + } + #[doc = "Create empty file for a run and Get Sas uri for the file"] + #[doc = ""] + #[doc = "See [`test_log_store_endpoint_details_for_run`](super::super::testlogstoreendpoint::Client::test_log_store_endpoint_details_for_run) for details of the arguments."] + pub fn test_log_store_endpoint_details_for_run( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_log_store_operation_type: impl Into, + ) -> test_log_store_endpoint_details_for_run::RequestBuilder + { + test_log_store_endpoint_details_for_run::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_log_store_operation_type: test_log_store_operation_type.into(), + file_path: None, + type_: None, + } + } + #[doc = "Get SAS Uri of a build attachment"] + #[doc = ""] + #[doc = "See [`get_test_log_store_endpoint_details_for_build_log`](super::super::testlogstoreendpoint::Client::get_test_log_store_endpoint_details_for_build_log) for details of the arguments."] + pub fn get_test_log_store_endpoint_details_for_build_log( + &self, + organization: impl Into, + project: impl Into, + build: i32, + type_: impl Into, + file_path: impl Into, + ) -> get_test_log_store_endpoint_details_for_build_log::RequestBuilder + { + get_test_log_store_endpoint_details_for_build_log::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build, + type_: type_.into(), + file_path: file_path.into(), + } + } + #[doc = "Create and Get sas uri of the build container"] + #[doc = ""] + #[doc = "See [`test_log_store_endpoint_details_for_build`](super::super::testlogstoreendpoint::Client::test_log_store_endpoint_details_for_build) for details of the arguments."] + pub fn test_log_store_endpoint_details_for_build( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + test_log_store_operation_type: impl Into, + ) -> test_log_store_endpoint_details_for_build::RequestBuilder + { + test_log_store_endpoint_details_for_build::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + test_log_store_operation_type: test_log_store_operation_type.into(), + } + } + } + } + pub mod attachments { + use super::super::attachments::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns attachment references for test sub result."] + #[doc = ""] + #[doc = "See [`get_test_sub_result_attachments`](super::super::attachments::Client::get_test_sub_result_attachments) for details of the arguments."] + pub fn get_test_sub_result_attachments( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + test_sub_result_id: i32, + ) -> get_test_sub_result_attachments::RequestBuilder { + get_test_sub_result_attachments::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + test_sub_result_id, + } + } + #[doc = "See [`create_test_sub_result_attachment`](super::super::attachments::Client::create_test_sub_result_attachment) for details of the arguments."] + pub fn create_test_sub_result_attachment( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + test_sub_result_id: i32, + ) -> create_test_sub_result_attachment::RequestBuilder { + create_test_sub_result_attachment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + run_id, + test_case_result_id, + test_sub_result_id, + } + } + #[doc = "See [`create_test_iteration_result_attachment`](super::super::attachments::Client::create_test_iteration_result_attachment) for details of the arguments."] + pub fn create_test_iteration_result_attachment( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + iteration_id: i32, + ) -> create_test_iteration_result_attachment::RequestBuilder + { + create_test_iteration_result_attachment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + run_id, + test_case_result_id, + iteration_id, + action_path: None, + } + } + #[doc = "Returns a test sub result attachment"] + #[doc = ""] + #[doc = "See [`get_test_sub_result_attachment_zip`](super::super::attachments::Client::get_test_sub_result_attachment_zip) for details of the arguments."] + pub fn get_test_sub_result_attachment_zip( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + attachment_id: i32, + test_sub_result_id: i32, + ) -> get_test_sub_result_attachment_zip::RequestBuilder { + get_test_sub_result_attachment_zip::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + attachment_id, + test_sub_result_id, + } + } + #[doc = "Returns a test iteration attachment"] + #[doc = ""] + #[doc = "See [`get_test_iteration_attachment_zip`](super::super::attachments::Client::get_test_iteration_attachment_zip) for details of the arguments."] + pub fn get_test_iteration_attachment_zip( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + attachment_id: i32, + iteration_id: i32, + ) -> get_test_iteration_attachment_zip::RequestBuilder { + get_test_iteration_attachment_zip::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + attachment_id, + iteration_id, + } + } + #[doc = "See [`get_test_run_attachments`](super::super::attachments::Client::get_test_run_attachments) for details of the arguments."] + pub fn get_test_run_attachments( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + ) -> get_test_run_attachments::RequestBuilder { + get_test_run_attachments::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + } + } + #[doc = "See [`create_test_run_attachment`](super::super::attachments::Client::create_test_run_attachment) for details of the arguments."] + pub fn create_test_run_attachment( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + run_id: i32, + ) -> create_test_run_attachment::RequestBuilder { + create_test_run_attachment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + run_id, + } + } + #[doc = "Returns a test run attachment"] + #[doc = ""] + #[doc = "See [`get_test_run_attachment_zip`](super::super::attachments::Client::get_test_run_attachment_zip) for details of the arguments."] + pub fn get_test_run_attachment_zip( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + attachment_id: i32, + ) -> get_test_run_attachment_zip::RequestBuilder { + get_test_run_attachment_zip::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + attachment_id, + } + } + #[doc = "See [`delete_test_run_attachment`](super::super::attachments::Client::delete_test_run_attachment) for details of the arguments."] + pub fn delete_test_run_attachment( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + attachment_id: i32, + ) -> delete_test_run_attachment::RequestBuilder { + delete_test_run_attachment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + attachment_id, + } + } + #[doc = "See [`get_test_result_attachments`](super::super::attachments::Client::get_test_result_attachments) for details of the arguments."] + pub fn get_test_result_attachments( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + ) -> get_test_result_attachments::RequestBuilder { + get_test_result_attachments::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + } + } + #[doc = "See [`create_test_result_attachment`](super::super::attachments::Client::create_test_result_attachment) for details of the arguments."] + pub fn create_test_result_attachment( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + ) -> create_test_result_attachment::RequestBuilder { + create_test_result_attachment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + run_id, + test_case_result_id, + } + } + #[doc = "Returns a test result attachment"] + #[doc = ""] + #[doc = "See [`get_test_result_attachment_zip`](super::super::attachments::Client::get_test_result_attachment_zip) for details of the arguments."] + pub fn get_test_result_attachment_zip( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + attachment_id: i32, + ) -> get_test_result_attachment_zip::RequestBuilder { + get_test_result_attachment_zip::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + attachment_id, + } + } + #[doc = "See [`delete_test_result_attachment`](super::super::attachments::Client::delete_test_result_attachment) for details of the arguments."] + pub fn delete_test_result_attachment( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + attachment_id: i32, + ) -> delete_test_result_attachment::RequestBuilder { + delete_test_result_attachment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + attachment_id, + } + } + } + } + pub mod testattachments { + use super::super::models; + use super::super::testattachments::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns the attachment with the specified filename for the specified runId from the LogStore."] + #[doc = ""] + #[doc = "See [`get`](super::super::testattachments::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + filename: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + filename: filename.into(), + } + } + #[doc = "Returns a list of attachments for the specified runId from the LogStore."] + #[doc = ""] + #[doc = "See [`list`](super::super::testattachments::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + } + } + #[doc = "Creates an attachment in the LogStore for the specified runId."] + #[doc = ""] + #[doc = "See [`create_test_run_log_store_attachment`](super::super::testattachments::Client::create_test_run_log_store_attachment) for details of the arguments."] + pub fn create_test_run_log_store_attachment( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + run_id: i32, + ) -> create_test_run_log_store_attachment::RequestBuilder { + create_test_run_log_store_attachment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + run_id, + } + } + #[doc = "Deletes the attachment with the specified filename for the specified runId from the LogStore."] + #[doc = ""] + #[doc = "See [`delete`](super::super::testattachments::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + filename: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + filename: filename.into(), + } + } + #[doc = "Creates an attachment in the LogStore for the specified buildId."] + #[doc = ""] + #[doc = "See [`create_build_attachment_in_log_store`](super::super::testattachments::Client::create_build_attachment_in_log_store) for details of the arguments."] + pub fn create_build_attachment_in_log_store( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + build_id: i32, + ) -> create_build_attachment_in_log_store::RequestBuilder { + create_build_attachment_in_log_store::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + build_id, + } + } + } + } + pub mod tags { + use super::super::models; + use super::super::tags::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`get_test_tags_for_release`](super::super::tags::Client::get_test_tags_for_release) for details of the arguments."] + pub fn get_test_tags_for_release( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + release_env_id: i32, + ) -> get_test_tags_for_release::RequestBuilder { + get_test_tags_for_release::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + release_env_id, + } + } + #[doc = "See [`update`](super::super::tags::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + run_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + run_id, + } + } + #[doc = "See [`get_test_tags_for_build`](super::super::tags::Client::get_test_tags_for_build) for details of the arguments."] + pub fn get_test_tags_for_build( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> get_test_tags_for_build::RequestBuilder { + get_test_tags_for_build::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + } + } + } + } + pub mod tagsummary { + use super::super::models; + use super::super::tagsummary::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`get_test_tag_summary_for_release`](super::super::tagsummary::Client::get_test_tag_summary_for_release) for details of the arguments."] + pub fn get_test_tag_summary_for_release( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + release_env_id: i32, + ) -> get_test_tag_summary_for_release::RequestBuilder { + get_test_tag_summary_for_release::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + release_env_id, + } + } + #[doc = "See [`get_test_tag_summary_for_build`](super::super::tagsummary::Client::get_test_tag_summary_for_build) for details of the arguments."] + pub fn get_test_tag_summary_for_build( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> get_test_tag_summary_for_build::RequestBuilder { + get_test_tag_summary_for_build::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + } + } + } + } + pub mod workitems { + use super::super::models; + use super::super::workitems::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`query_test_method_linked_work_items`](super::super::workitems::Client::query_test_method_linked_work_items) for details of the arguments."] + pub fn query_test_method_linked_work_items( + &self, + organization: impl Into, + project: impl Into, + test_name: impl Into, + ) -> query_test_method_linked_work_items::RequestBuilder { + query_test_method_linked_work_items::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_name: test_name.into(), + } + } + #[doc = "Query Test Result WorkItems based on filter"] + #[doc = ""] + #[doc = "See [`query_test_result_work_items`](super::super::workitems::Client::query_test_result_work_items) for details of the arguments."] + pub fn query_test_result_work_items( + &self, + organization: impl Into, + project: impl Into, + work_item_category: impl Into, + ) -> query_test_result_work_items::RequestBuilder { + query_test_result_work_items::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + work_item_category: work_item_category.into(), + automated_test_name: None, + test_case_id: None, + max_complete_date: None, + days: None, + work_item_count: None, + } + } + #[doc = "See [`list`](super::super::workitems::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + } + } + #[doc = "See [`add`](super::super::workitems::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "See [`delete`](super::super::workitems::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + test_name: impl Into, + work_item_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_name: test_name.into(), + work_item_id, + } + } + } + } + pub mod filecoverage { + use super::super::filecoverage::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get file coverage for the specified file"] + #[doc = ""] + #[doc = "See [`get`](super::super::filecoverage::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod status { + use super::super::models; + use super::super::status::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "

Gets the coverage status for the last successful build of a definition, optionally scoped to a specific branch

"] + #[doc = ""] + #[doc = "See [`get`](super::super::status::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + definition: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + definition: definition.into(), + branch_name: None, + label: None, + } + } + } + } + pub mod metrics { + use super::super::metrics::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get summary of test results."] + #[doc = ""] + #[doc = "See [`get`](super::super::metrics::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + pipeline_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + pipeline_id, + stage_name: None, + phase_name: None, + job_name: None, + metric_names: None, + group_by_node: None, + } + } + } + } + pub mod resultdetailsbybuild { + use super::super::models; + use super::super::resultdetailsbybuild::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`get`](super::super::resultdetailsbybuild::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + publish_context: None, + group_by: None, + filter: None, + orderby: None, + should_include_results: None, + query_run_summary_for_in_progress: None, + } + } + } + } + pub mod resultdetailsbyrelease { + use super::super::models; + use super::super::resultdetailsbyrelease::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`get`](super::super::resultdetailsbyrelease::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + release_env_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + release_env_id, + publish_context: None, + group_by: None, + filter: None, + orderby: None, + should_include_results: None, + query_run_summary_for_in_progress: None, + } + } + } + } + pub mod resultgroupsbybuild { + use super::super::models; + use super::super::resultgroupsbybuild::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`list`](super::super::resultgroupsbybuild::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + publish_context: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + publish_context: publish_context.into(), + fields: None, + continuation_token: None, + } + } + } + } + pub mod resultgroupsbyrelease { + use super::super::models; + use super::super::resultgroupsbyrelease::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`list`](super::super::resultgroupsbyrelease::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + publish_context: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + publish_context: publish_context.into(), + release_env_id: None, + fields: None, + continuation_token: None, + } + } + } + } + pub mod results { + use super::super::models; + use super::super::results::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`get_test_results_by_query`](super::super::results::Client::get_test_results_by_query) for details of the arguments."] + pub fn get_test_results_by_query( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> get_test_results_by_query::RequestBuilder { + get_test_results_by_query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "See [`get_test_results_by_query_wiql`](super::super::results::Client::get_test_results_by_query_wiql) for details of the arguments."] + pub fn get_test_results_by_query_wiql( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> get_test_results_by_query_wiql::RequestBuilder { + get_test_results_by_query_wiql::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + include_result_details: None, + include_iteration_details: None, + skip: None, + top: None, + } + } + #[doc = "See [`get_test_results`](super::super::results::Client::get_test_results) for details of the arguments."] + pub fn get_test_results( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + ) -> get_test_results::RequestBuilder { + get_test_results::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + details_to_include: None, + skip: None, + top: None, + outcomes: None, + new_tests_only: None, + } + } + #[doc = "See [`add`](super::super::results::Client::add) for details of the arguments."] + pub fn add( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + run_id: i32, + ) -> add::RequestBuilder { + add::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + run_id, + } + } + #[doc = "See [`update`](super::super::results::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + run_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + run_id, + } + } + #[doc = "See [`get_test_result_by_id`](super::super::results::Client::get_test_result_by_id) for details of the arguments."] + pub fn get_test_result_by_id( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_result_id: i32, + ) -> get_test_result_by_id::RequestBuilder { + get_test_result_by_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_result_id, + details_to_include: None, + } + } + } + } + pub mod history { + use super::super::history::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`query`](super::super::history::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod result_meta_data { + use super::super::models; + use super::super::result_meta_data::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get list of test Result meta data details for corresponding testcasereferenceId"] + #[doc = ""] + #[doc = "See [`query`](super::super::result_meta_data::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + details_to_include: None, + } + } + #[doc = "Update properties of test result meta data"] + #[doc = ""] + #[doc = "See [`update`](super::super::result_meta_data::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + test_case_reference_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + test_case_reference_id, + } + } + } + } + pub mod test_history { + use super::super::models; + use super::super::test_history::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get history of a test method using TestHistoryQuery"] + #[doc = ""] + #[doc = "See [`query`](super::super::test_history::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod resultsbybuild { + use super::super::models; + use super::super::resultsbybuild::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`list`](super::super::resultsbybuild::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + publish_context: None, + outcomes: None, + top: None, + continuation_token: None, + } + } + } + } + pub mod resultsbypipeline { + use super::super::models; + use super::super::resultsbypipeline::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of results."] + #[doc = ""] + #[doc = "See [`list`](super::super::resultsbypipeline::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + pipeline_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + pipeline_id, + stage_name: None, + phase_name: None, + job_name: None, + outcomes: None, + top: None, + continuation_token: None, + } + } + } + } + pub mod resultsbyrelease { + use super::super::models; + use super::super::resultsbyrelease::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`list`](super::super::resultsbyrelease::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + release_envid: None, + publish_context: None, + outcomes: None, + top: None, + continuation_token: None, + } + } + } + } + pub mod resultsgroup_details { + use super::super::models; + use super::super::resultsgroup_details::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all the available groups details and for these groups get failed and aborted results."] + #[doc = ""] + #[doc = "See [`test_results_group_details`](super::super::resultsgroup_details::Client::test_results_group_details) for details of the arguments."] + pub fn test_results_group_details( + &self, + organization: impl Into, + project: impl Into, + pipeline_id: i32, + ) -> test_results_group_details::RequestBuilder { + test_results_group_details::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + pipeline_id, + stage_name: None, + phase_name: None, + job_name: None, + should_include_failed_and_aborted_results: None, + query_group_summary_for_in_progress: None, + } + } + } + } + pub mod resultsummarybybuild { + use super::super::models; + use super::super::resultsummarybybuild::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`query`](super::super::resultsummarybybuild::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + project: impl Into, + build_id: i32, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + build_id, + publish_context: None, + include_failure_details: None, + build_to_compare_branch_name: None, + build_to_compare_build_system: None, + build_to_compare_definition_id: None, + build_to_compare_id: None, + build_to_compare_number: None, + build_to_compare_repository_id: None, + build_to_compare_uri: None, + } + } + } + } + pub mod resultsummarybypipeline { + use super::super::models; + use super::super::resultsummarybypipeline::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get summary of test results."] + #[doc = ""] + #[doc = "See [`query`](super::super::resultsummarybypipeline::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + project: impl Into, + pipeline_id: i32, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + pipeline_id, + stage_name: None, + phase_name: None, + job_name: None, + include_failure_details: None, + } + } + } + } + pub mod resultsummarybyrelease { + use super::super::models; + use super::super::resultsummarybyrelease::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`query_test_results_report_for_release`](super::super::resultsummarybyrelease::Client::query_test_results_report_for_release) for details of the arguments."] + pub fn query_test_results_report_for_release( + &self, + organization: impl Into, + project: impl Into, + release_id: i32, + release_env_id: i32, + ) -> query_test_results_report_for_release::RequestBuilder { + query_test_results_report_for_release::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + release_id, + release_env_id, + publish_context: None, + include_failure_details: None, + release_to_compare_attempt: None, + release_to_compare_creation_date: None, + release_to_compare_definition_id: None, + release_to_compare_environment_creation_date: None, + release_to_compare_environment_definition_id: None, + release_to_compare_environment_definition_name: None, + release_to_compare_environment_id: None, + release_to_compare_environment_name: None, + release_to_compare_id: None, + release_to_compare_name: None, + } + } + #[doc = "See [`query_test_results_summary_for_releases`](super::super::resultsummarybyrelease::Client::query_test_results_summary_for_releases) for details of the arguments."] + pub fn query_test_results_summary_for_releases( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + ) -> query_test_results_summary_for_releases::RequestBuilder + { + query_test_results_summary_for_releases::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + } + } + } + } + pub mod resultsummarybyrequirement { + use super::super::models; + use super::super::resultsummarybyrequirement::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`query`](super::super::resultsummarybyrequirement::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + work_item_ids: None, + } + } + } + } + pub mod result_trend_by_build { + use super::super::models; + use super::super::result_trend_by_build::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`query`](super::super::result_trend_by_build::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod result_trend_by_release { + use super::super::models; + use super::super::result_trend_by_release::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`query`](super::super::result_trend_by_release::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod message_logs { + use super::super::message_logs::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get test run message logs"] + #[doc = ""] + #[doc = "See [`list`](super::super::message_logs::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + } + } + } + } + pub mod result_document { + use super::super::models; + use super::super::result_document::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`publish_test_result_document`](super::super::result_document::Client::publish_test_result_document) for details of the arguments."] + pub fn publish_test_result_document( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + run_id: i32, + ) -> publish_test_result_document::RequestBuilder { + publish_test_result_document::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + run_id, + } + } + } + } + pub mod bugs { + use super::super::bugs::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`list`](super::super::bugs::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_case_result_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_case_result_id, + } + } + } + } + pub mod similar_test_results { + use super::super::models; + use super::super::similar_test_results::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the list of results whose failure matches with the provided one."] + #[doc = ""] + #[doc = "See [`list`](super::super::similar_test_results::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + test_result_id: i32, + test_sub_result_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + test_result_id, + test_sub_result_id, + top: None, + continuation_token: None, + } + } + } + } + pub mod runsummary { + use super::super::models; + use super::super::runsummary::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get test run summary, used when we want to get summary of a run by outcome. Test run should be in completed state."] + #[doc = ""] + #[doc = "See [`get`](super::super::runsummary::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + } + } + } + } + pub mod statistics { + use super::super::models; + use super::super::statistics::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get test run statistics , used when we want to get summary of a run by outcome."] + #[doc = ""] + #[doc = "See [`get`](super::super::statistics::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + run_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + run_id, + } + } + } + } + pub mod settings { + use super::super::models; + use super::super::settings::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get TestResultsSettings data"] + #[doc = ""] + #[doc = "See [`get`](super::super::settings::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + settings_type: None, + } + } + #[doc = "Update project settings of test results"] + #[doc = ""] + #[doc = "See [`update`](super::super::settings::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod testfailuretype { + use super::super::models; + use super::super::testfailuretype::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns the list of test failure types."] + #[doc = ""] + #[doc = "See [`list`](super::super::testfailuretype::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Creates a new test failure type"] + #[doc = ""] + #[doc = "See [`create`](super::super::testfailuretype::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Deletes a test failure type with specified failureTypeId"] + #[doc = ""] + #[doc = "See [`delete`](super::super::testfailuretype::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + failure_type_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + failure_type_id, + } + } + } + } + pub mod testsettings { + use super::super::models; + use super::super::testsettings::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`get`](super::super::testsettings::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + test_settings_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_settings_id, + } + } + #[doc = "See [`create`](super::super::testsettings::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "See [`delete`](super::super::testsettings::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + test_settings_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + test_settings_id, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/tfvc/mod.rs b/azure_devops_rust_api/src/tfvc/mod.rs index 69a3ea80..05162020 100644 --- a/azure_devops_rust_api/src/tfvc/mod.rs +++ b/azure_devops_rust_api/src/tfvc/mod.rs @@ -265,8 +265,12 @@ pub mod shelvesets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) request_data_include_details: Option, pub(crate) request_data_include_links: Option, @@ -278,7 +282,7 @@ pub mod shelvesets { pub(crate) top: Option, pub(crate) skip: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Whether to include policyOverride and notes Only applies when requesting a single deep shelveset"] pub fn request_data_include_details( mut self, @@ -336,6 +340,86 @@ pub mod shelvesets { self.skip = Some(skip); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(request_data_include_details) = &this.request_data_include_details { + req.url_mut().query_pairs_mut().append_pair( + "requestData.includeDetails", + &request_data_include_details.to_string(), + ); + } + if let Some(request_data_include_links) = &this.request_data_include_links { + req.url_mut().query_pairs_mut().append_pair( + "requestData.includeLinks", + &request_data_include_links.to_string(), + ); + } + if let Some(request_data_include_work_items) = &this.request_data_include_work_items + { + req.url_mut().query_pairs_mut().append_pair( + "requestData.includeWorkItems", + &request_data_include_work_items.to_string(), + ); + } + if let Some(request_data_max_change_count) = &this.request_data_max_change_count { + req.url_mut().query_pairs_mut().append_pair( + "requestData.maxChangeCount", + &request_data_max_change_count.to_string(), + ); + } + if let Some(request_data_max_comment_length) = &this.request_data_max_comment_length + { + req.url_mut().query_pairs_mut().append_pair( + "requestData.maxCommentLength", + &request_data_max_comment_length.to_string(), + ); + } + if let Some(request_data_name) = &this.request_data_name { + req.url_mut() + .query_pairs_mut() + .append_pair("requestData.name", request_data_name); + } + if let Some(request_data_owner) = &this.request_data_owner { + req.url_mut() + .query_pairs_mut() + .append_pair("requestData.owner", request_data_owner); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -344,9 +428,7 @@ pub mod shelvesets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -358,82 +440,24 @@ pub mod shelvesets { auth_header, ); } - if let Some(request_data_include_details) = - &this.request_data_include_details - { - req.url_mut().query_pairs_mut().append_pair( - "requestData.includeDetails", - &request_data_include_details.to_string(), - ); - } - if let Some(request_data_include_links) = &this.request_data_include_links { - req.url_mut().query_pairs_mut().append_pair( - "requestData.includeLinks", - &request_data_include_links.to_string(), - ); - } - if let Some(request_data_include_work_items) = - &this.request_data_include_work_items - { - req.url_mut().query_pairs_mut().append_pair( - "requestData.includeWorkItems", - &request_data_include_work_items.to_string(), - ); - } - if let Some(request_data_max_change_count) = - &this.request_data_max_change_count - { - req.url_mut().query_pairs_mut().append_pair( - "requestData.maxChangeCount", - &request_data_max_change_count.to_string(), - ); - } - if let Some(request_data_max_comment_length) = - &this.request_data_max_comment_length - { - req.url_mut().query_pairs_mut().append_pair( - "requestData.maxCommentLength", - &request_data_max_comment_length.to_string(), - ); - } - if let Some(request_data_name) = &this.request_data_name { - req.url_mut() - .query_pairs_mut() - .append_pair("requestData.name", request_data_name); - } - if let Some(request_data_owner) = &this.request_data_owner { - req.url_mut() - .query_pairs_mut() - .append_pair("requestData.owner", request_data_owner); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -483,8 +507,12 @@ pub mod shelvesets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) shelveset_id: String, pub(crate) request_data_include_details: Option, @@ -495,7 +523,7 @@ pub mod shelvesets { pub(crate) request_data_name: Option, pub(crate) request_data_owner: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Whether to include policyOverride and notes Only applies when requesting a single deep shelveset"] pub fn request_data_include_details( mut self, @@ -543,6 +571,80 @@ pub mod shelvesets { self.request_data_owner = Some(request_data_owner.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let shelveset_id = &this.shelveset_id; + req.url_mut() + .query_pairs_mut() + .append_pair("shelvesetId", shelveset_id); + if let Some(request_data_include_details) = &this.request_data_include_details { + req.url_mut().query_pairs_mut().append_pair( + "requestData.includeDetails", + &request_data_include_details.to_string(), + ); + } + if let Some(request_data_include_links) = &this.request_data_include_links { + req.url_mut().query_pairs_mut().append_pair( + "requestData.includeLinks", + &request_data_include_links.to_string(), + ); + } + if let Some(request_data_include_work_items) = &this.request_data_include_work_items + { + req.url_mut().query_pairs_mut().append_pair( + "requestData.includeWorkItems", + &request_data_include_work_items.to_string(), + ); + } + if let Some(request_data_max_change_count) = &this.request_data_max_change_count { + req.url_mut().query_pairs_mut().append_pair( + "requestData.maxChangeCount", + &request_data_max_change_count.to_string(), + ); + } + if let Some(request_data_max_comment_length) = &this.request_data_max_comment_length + { + req.url_mut().query_pairs_mut().append_pair( + "requestData.maxCommentLength", + &request_data_max_comment_length.to_string(), + ); + } + if let Some(request_data_name) = &this.request_data_name { + req.url_mut() + .query_pairs_mut() + .append_pair("requestData.name", request_data_name); + } + if let Some(request_data_owner) = &this.request_data_owner { + req.url_mut() + .query_pairs_mut() + .append_pair("requestData.owner", request_data_owner); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -551,9 +653,7 @@ pub mod shelvesets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -565,76 +665,24 @@ pub mod shelvesets { auth_header, ); } - let shelveset_id = &this.shelveset_id; - req.url_mut() - .query_pairs_mut() - .append_pair("shelvesetId", shelveset_id); - if let Some(request_data_include_details) = - &this.request_data_include_details - { - req.url_mut().query_pairs_mut().append_pair( - "requestData.includeDetails", - &request_data_include_details.to_string(), - ); - } - if let Some(request_data_include_links) = &this.request_data_include_links { - req.url_mut().query_pairs_mut().append_pair( - "requestData.includeLinks", - &request_data_include_links.to_string(), - ); - } - if let Some(request_data_include_work_items) = - &this.request_data_include_work_items - { - req.url_mut().query_pairs_mut().append_pair( - "requestData.includeWorkItems", - &request_data_include_work_items.to_string(), - ); - } - if let Some(request_data_max_change_count) = - &this.request_data_max_change_count - { - req.url_mut().query_pairs_mut().append_pair( - "requestData.maxChangeCount", - &request_data_max_change_count.to_string(), - ); - } - if let Some(request_data_max_comment_length) = - &this.request_data_max_comment_length - { - req.url_mut().query_pairs_mut().append_pair( - "requestData.maxCommentLength", - &request_data_max_comment_length.to_string(), - ); - } - if let Some(request_data_name) = &this.request_data_name { - req.url_mut() - .query_pairs_mut() - .append_pair("requestData.name", request_data_name); - } - if let Some(request_data_owner) = &this.request_data_owner { - req.url_mut() - .query_pairs_mut() - .append_pair("requestData.owner", request_data_owner); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -684,14 +732,18 @@ pub mod shelvesets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) shelveset_id: String, pub(crate) top: Option, pub(crate) skip: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Max number of changes to return"] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -702,6 +754,48 @@ pub mod shelvesets { self.skip = Some(skip); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let shelveset_id = &this.shelveset_id; + req.url_mut() + .query_pairs_mut() + .append_pair("shelvesetId", shelveset_id); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -710,9 +804,7 @@ pub mod shelvesets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -724,38 +816,24 @@ pub mod shelvesets { auth_header, ); } - let shelveset_id = &this.shelveset_id; - req.url_mut() - .query_pairs_mut() - .append_pair("shelvesetId", shelveset_id); - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -808,11 +886,46 @@ pub mod shelvesets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) shelveset_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let shelveset_id = &this.shelveset_id; + req.url_mut() + .query_pairs_mut() + .append_pair("shelvesetId", shelveset_id); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -822,9 +935,7 @@ pub mod shelvesets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -836,28 +947,24 @@ pub mod shelvesets { auth_header, ); } - let shelveset_id = &this.shelveset_id; - req.url_mut() - .query_pairs_mut() - .append_pair("shelvesetId", shelveset_id); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -980,15 +1087,19 @@ pub mod branches { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) path: String, pub(crate) project: String, pub(crate) include_parent: Option, pub(crate) include_children: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Return the parent branch, if there is one. Default: False"] pub fn include_parent(mut self, include_parent: bool) -> Self { self.include_parent = Some(include_parent); @@ -999,6 +1110,48 @@ pub mod branches { self.include_children = Some(include_children); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let path = &this.path; + req.url_mut().query_pairs_mut().append_pair("path", path); + if let Some(include_parent) = &this.include_parent { + req.url_mut() + .query_pairs_mut() + .append_pair("includeParent", &include_parent.to_string()); + } + if let Some(include_children) = &this.include_children { + req.url_mut() + .query_pairs_mut() + .append_pair("includeChildren", &include_children.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/branches?path={}", + self.client.endpoint(), + self.organization, + self.project, + self.path + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1007,9 +1160,7 @@ pub mod branches { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1021,38 +1172,24 @@ pub mod branches { auth_header, ); } - let path = &this.path; - req.url_mut().query_pairs_mut().append_pair("path", path); - if let Some(include_parent) = &this.include_parent { - req.url_mut() - .query_pairs_mut() - .append_pair("includeParent", &include_parent.to_string()); - } - if let Some(include_children) = &this.include_children { - req.url_mut() - .query_pairs_mut() - .append_pair("includeChildren", &include_children.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/branches?path={}", - self.client.endpoint(), - self.organization, - self.project, - self.path - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1102,8 +1239,12 @@ pub mod branches { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) include_parent: Option, @@ -1111,7 +1252,7 @@ pub mod branches { pub(crate) include_deleted: Option, pub(crate) include_links: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Return the parent branch, if there is one. Default: False"] pub fn include_parent(mut self, include_parent: bool) -> Self { self.include_parent = Some(include_parent); @@ -1132,6 +1273,55 @@ pub mod branches { self.include_links = Some(include_links); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_parent) = &this.include_parent { + req.url_mut() + .query_pairs_mut() + .append_pair("includeParent", &include_parent.to_string()); + } + if let Some(include_children) = &this.include_children { + req.url_mut() + .query_pairs_mut() + .append_pair("includeChildren", &include_children.to_string()); + } + if let Some(include_deleted) = &this.include_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDeleted", &include_deleted.to_string()); + } + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/branches?", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1140,9 +1330,7 @@ pub mod branches { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1154,45 +1342,24 @@ pub mod branches { auth_header, ); } - if let Some(include_parent) = &this.include_parent { - req.url_mut() - .query_pairs_mut() - .append_pair("includeParent", &include_parent.to_string()); - } - if let Some(include_children) = &this.include_children { - req.url_mut() - .query_pairs_mut() - .append_pair("includeChildren", &include_children.to_string()); - } - if let Some(include_deleted) = &this.include_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("includeDeleted", &include_deleted.to_string()); - } - 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/branches?", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1242,15 +1409,19 @@ pub mod branches { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) scope_path: String, pub(crate) project: String, pub(crate) include_deleted: Option, pub(crate) include_links: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Return deleted branches. Default: False"] pub fn include_deleted(mut self, include_deleted: bool) -> Self { self.include_deleted = Some(include_deleted); @@ -1261,6 +1432,49 @@ pub mod branches { self.include_links = Some(include_links); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let scope_path = &this.scope_path; + req.url_mut() + .query_pairs_mut() + .append_pair("scopePath", scope_path); + if let Some(include_deleted) = &this.include_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDeleted", &include_deleted.to_string()); + } + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/branches", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1269,9 +1483,7 @@ pub mod branches { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1283,39 +1495,24 @@ pub mod branches { auth_header, ); } - let scope_path = &this.scope_path; - req.url_mut() - .query_pairs_mut() - .append_pair("scopePath", scope_path); - if let Some(include_deleted) = &this.include_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("includeDeleted", &include_deleted.to_string()); - } - 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/branches", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1442,8 +1639,12 @@ pub mod items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) path: String, pub(crate) project: String, @@ -1456,7 +1657,7 @@ pub mod items { pub(crate) version_descriptor_version_type: Option, pub(crate) include_content: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "File name of item returned."] pub fn file_name(mut self, file_name: impl Into) -> Self { self.file_name = Some(file_name.into()); @@ -1510,6 +1711,83 @@ pub mod items { self.include_content = Some(include_content); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let path = &this.path; + req.url_mut().query_pairs_mut().append_pair("path", path); + if let Some(file_name) = &this.file_name { + req.url_mut() + .query_pairs_mut() + .append_pair("fileName", file_name); + } + if let Some(download) = &this.download { + req.url_mut() + .query_pairs_mut() + .append_pair("download", &download.to_string()); + } + if let Some(scope_path) = &this.scope_path { + req.url_mut() + .query_pairs_mut() + .append_pair("scopePath", scope_path); + } + if let Some(recursion_level) = &this.recursion_level { + req.url_mut() + .query_pairs_mut() + .append_pair("recursionLevel", &recursion_level.to_string()); + } + if let Some(version_descriptor_version) = &this.version_descriptor_version { + req.url_mut() + .query_pairs_mut() + .append_pair("versionDescriptor.version", version_descriptor_version); + } + if let Some(version_descriptor_version_option) = + &this.version_descriptor_version_option + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionOption", + &version_descriptor_version_option.to_string(), + ); + } + if let Some(version_descriptor_version_type) = &this.version_descriptor_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionType", + &version_descriptor_version_type.to_string(), + ); + } + if let Some(include_content) = &this.include_content { + req.url_mut() + .query_pairs_mut() + .append_pair("includeContent", &include_content.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/items?path={}", + self.client.endpoint(), + self.organization, + self.project, + self.path + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1518,9 +1796,7 @@ pub mod items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1532,75 +1808,24 @@ pub mod items { auth_header, ); } - let path = &this.path; - req.url_mut().query_pairs_mut().append_pair("path", path); - if let Some(file_name) = &this.file_name { - req.url_mut() - .query_pairs_mut() - .append_pair("fileName", file_name); - } - if let Some(download) = &this.download { - req.url_mut() - .query_pairs_mut() - .append_pair("download", &download.to_string()); - } - if let Some(scope_path) = &this.scope_path { - req.url_mut() - .query_pairs_mut() - .append_pair("scopePath", scope_path); - } - if let Some(recursion_level) = &this.recursion_level { - req.url_mut() - .query_pairs_mut() - .append_pair("recursionLevel", &recursion_level.to_string()); - } - if let Some(version_descriptor_version) = &this.version_descriptor_version { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.version", - version_descriptor_version, - ); - } - if let Some(version_descriptor_version_option) = - &this.version_descriptor_version_option - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionOption", - &version_descriptor_version_option.to_string(), - ); - } - if let Some(version_descriptor_version_type) = - &this.version_descriptor_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionType", - &version_descriptor_version_type.to_string(), - ); - } - if let Some(include_content) = &this.include_content { - req.url_mut() - .query_pairs_mut() - .append_pair("includeContent", &include_content.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/items?path={}", - self.client.endpoint(), - self.organization, - self.project, - self.path - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1648,12 +1873,45 @@ pub mod items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TfvcItemRequestData, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/itembatch", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1663,9 +1921,7 @@ pub mod items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1677,26 +1933,24 @@ pub mod items { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/itembatch", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1746,8 +2000,12 @@ pub mod items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) scope_path: Option, @@ -1757,7 +2015,7 @@ pub mod items { pub(crate) version_descriptor_version_option: Option, pub(crate) version_descriptor_version_type: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Version control path of a folder to return multiple items."] pub fn scope_path(mut self, scope_path: impl Into) -> Self { self.scope_path = Some(scope_path.into()); @@ -1799,6 +2057,70 @@ pub mod items { self.version_descriptor_version_type = Some(version_descriptor_version_type.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(scope_path) = &this.scope_path { + req.url_mut() + .query_pairs_mut() + .append_pair("scopePath", scope_path); + } + if let Some(recursion_level) = &this.recursion_level { + req.url_mut() + .query_pairs_mut() + .append_pair("recursionLevel", &recursion_level.to_string()); + } + if let Some(include_links) = &this.include_links { + req.url_mut() + .query_pairs_mut() + .append_pair("includeLinks", &include_links.to_string()); + } + if let Some(version_descriptor_version) = &this.version_descriptor_version { + req.url_mut() + .query_pairs_mut() + .append_pair("versionDescriptor.version", version_descriptor_version); + } + if let Some(version_descriptor_version_option) = + &this.version_descriptor_version_option + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionOption", + &version_descriptor_version_option.to_string(), + ); + } + if let Some(version_descriptor_version_type) = &this.version_descriptor_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionType", + &version_descriptor_version_type.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/items", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1807,9 +2129,7 @@ pub mod items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1821,62 +2141,24 @@ pub mod items { auth_header, ); } - if let Some(scope_path) = &this.scope_path { - req.url_mut() - .query_pairs_mut() - .append_pair("scopePath", scope_path); - } - if let Some(recursion_level) = &this.recursion_level { - req.url_mut() - .query_pairs_mut() - .append_pair("recursionLevel", &recursion_level.to_string()); - } - if let Some(include_links) = &this.include_links { - req.url_mut() - .query_pairs_mut() - .append_pair("includeLinks", &include_links.to_string()); - } - if let Some(version_descriptor_version) = &this.version_descriptor_version { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.version", - version_descriptor_version, - ); - } - if let Some(version_descriptor_version_option) = - &this.version_descriptor_version_option - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionOption", - &version_descriptor_version_option.to_string(), - ); - } - if let Some(version_descriptor_version_type) = - &this.version_descriptor_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionType", - &version_descriptor_version_type.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/items", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2070,15 +2352,19 @@ pub mod changesets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: i32, pub(crate) skip: Option, pub(crate) top: Option, pub(crate) continuation_token: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Number of results to skip. Default: null"] pub fn skip(mut self, skip: i32) -> Self { self.skip = Some(skip); @@ -2094,6 +2380,50 @@ pub mod changesets { self.continuation_token = Some(continuation_token.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/tfvc/changesets/{}/changes", + self.client.endpoint(), + self.organization, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2102,9 +2432,7 @@ pub mod changesets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2116,40 +2444,24 @@ pub mod changesets { auth_header, ); } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/tfvc/changesets/{}/changes", - self.client.endpoint(), - self.organization, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2202,11 +2514,43 @@ pub mod changesets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/tfvc/changesets/{}/workItems", + self.client.endpoint(), + self.organization, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2216,9 +2560,7 @@ pub mod changesets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2230,25 +2572,24 @@ pub mod changesets { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/tfvc/changesets/{}/workItems", - self.client.endpoint(), - self.organization, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2299,13 +2640,45 @@ pub mod changesets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TfvcChangesetsRequestData, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] #[doc = "However, this function can provide more flexibility when required."] @@ -2313,9 +2686,7 @@ pub mod changesets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2327,25 +2698,24 @@ pub mod changesets { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2395,8 +2765,12 @@ pub mod changesets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) max_comment_length: Option, @@ -2413,7 +2787,7 @@ pub mod changesets { pub(crate) search_criteria_to_date: Option, pub(crate) search_criteria_to_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Include details about associated work items in the response. Default: null"] pub fn max_comment_length(mut self, max_comment_length: i32) -> Self { self.max_comment_length = Some(max_comment_length); @@ -2500,6 +2874,98 @@ pub mod changesets { self.search_criteria_to_id = Some(search_criteria_to_id); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(max_comment_length) = &this.max_comment_length { + req.url_mut() + .query_pairs_mut() + .append_pair("maxCommentLength", &max_comment_length.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(orderby) = &this.orderby { + req.url_mut() + .query_pairs_mut() + .append_pair("$orderby", orderby); + } + if let Some(search_criteria_author) = &this.search_criteria_author { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.author", search_criteria_author); + } + if let Some(search_criteria_follow_renames) = &this.search_criteria_follow_renames { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.followRenames", + &search_criteria_follow_renames.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); + } + if let Some(search_criteria_from_id) = &this.search_criteria_from_id { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.fromId", + &search_criteria_from_id.to_string(), + ); + } + if let Some(search_criteria_include_links) = &this.search_criteria_include_links { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.includeLinks", + &search_criteria_include_links.to_string(), + ); + } + if let Some(search_criteria_item_path) = &this.search_criteria_item_path { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.itemPath", search_criteria_item_path); + } + 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); + } + if let Some(search_criteria_to_id) = &this.search_criteria_to_id { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.toId", &search_criteria_to_id.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/changesets", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2508,9 +2974,7 @@ pub mod changesets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2522,93 +2986,24 @@ pub mod changesets { auth_header, ); } - if let Some(max_comment_length) = &this.max_comment_length { - req.url_mut() - .query_pairs_mut() - .append_pair("maxCommentLength", &max_comment_length.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(orderby) = &this.orderby { - req.url_mut() - .query_pairs_mut() - .append_pair("$orderby", orderby); - } - if let Some(search_criteria_author) = &this.search_criteria_author { - req.url_mut() - .query_pairs_mut() - .append_pair("searchCriteria.author", search_criteria_author); - } - if let Some(search_criteria_follow_renames) = - &this.search_criteria_follow_renames - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.followRenames", - &search_criteria_follow_renames.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); - } - if let Some(search_criteria_from_id) = &this.search_criteria_from_id { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.fromId", - &search_criteria_from_id.to_string(), - ); - } - if let Some(search_criteria_include_links) = - &this.search_criteria_include_links - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.includeLinks", - &search_criteria_include_links.to_string(), - ); - } - if let Some(search_criteria_item_path) = &this.search_criteria_item_path { - req.url_mut() - .query_pairs_mut() - .append_pair("searchCriteria.itemPath", search_criteria_item_path); - } - 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); - } - if let Some(search_criteria_to_id) = &this.search_criteria_to_id { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.toId", - &search_criteria_to_id.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/changesets", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2658,12 +3053,45 @@ pub mod changesets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TfvcChangeset, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/changesets", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2673,9 +3101,7 @@ pub mod changesets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2687,26 +3113,24 @@ pub mod changesets { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/changesets", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2756,8 +3180,12 @@ pub mod changesets { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: i32, pub(crate) project: String, @@ -2779,7 +3207,7 @@ pub mod changesets { pub(crate) search_criteria_to_date: Option, pub(crate) search_criteria_to_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Number of changes to return (maximum 100 changes) Default: 0"] pub fn max_change_count(mut self, max_change_count: i32) -> Self { self.max_change_count = Some(max_change_count); @@ -2886,6 +3314,119 @@ pub mod changesets { self.search_criteria_to_id = Some(search_criteria_to_id); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(max_change_count) = &this.max_change_count { + req.url_mut() + .query_pairs_mut() + .append_pair("maxChangeCount", &max_change_count.to_string()); + } + if let Some(include_details) = &this.include_details { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDetails", &include_details.to_string()); + } + if let Some(include_work_items) = &this.include_work_items { + req.url_mut() + .query_pairs_mut() + .append_pair("includeWorkItems", &include_work_items.to_string()); + } + if let Some(max_comment_length) = &this.max_comment_length { + req.url_mut() + .query_pairs_mut() + .append_pair("maxCommentLength", &max_comment_length.to_string()); + } + if let Some(include_source_rename) = &this.include_source_rename { + req.url_mut() + .query_pairs_mut() + .append_pair("includeSourceRename", &include_source_rename.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(orderby) = &this.orderby { + req.url_mut() + .query_pairs_mut() + .append_pair("$orderby", orderby); + } + if let Some(search_criteria_author) = &this.search_criteria_author { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.author", search_criteria_author); + } + if let Some(search_criteria_follow_renames) = &this.search_criteria_follow_renames { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.followRenames", + &search_criteria_follow_renames.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); + } + if let Some(search_criteria_from_id) = &this.search_criteria_from_id { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.fromId", + &search_criteria_from_id.to_string(), + ); + } + if let Some(search_criteria_include_links) = &this.search_criteria_include_links { + req.url_mut().query_pairs_mut().append_pair( + "searchCriteria.includeLinks", + &search_criteria_include_links.to_string(), + ); + } + if let Some(search_criteria_item_path) = &this.search_criteria_item_path { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.itemPath", search_criteria_item_path); + } + 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); + } + if let Some(search_criteria_to_id) = &this.search_criteria_to_id { + req.url_mut() + .query_pairs_mut() + .append_pair("searchCriteria.toId", &search_criteria_to_id.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/changesets/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2894,9 +3435,7 @@ pub mod changesets { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2908,115 +3447,24 @@ pub mod changesets { auth_header, ); } - if let Some(max_change_count) = &this.max_change_count { - req.url_mut() - .query_pairs_mut() - .append_pair("maxChangeCount", &max_change_count.to_string()); - } - if let Some(include_details) = &this.include_details { - req.url_mut() - .query_pairs_mut() - .append_pair("includeDetails", &include_details.to_string()); - } - if let Some(include_work_items) = &this.include_work_items { - req.url_mut() - .query_pairs_mut() - .append_pair("includeWorkItems", &include_work_items.to_string()); - } - if let Some(max_comment_length) = &this.max_comment_length { - req.url_mut() - .query_pairs_mut() - .append_pair("maxCommentLength", &max_comment_length.to_string()); - } - if let Some(include_source_rename) = &this.include_source_rename { - req.url_mut().query_pairs_mut().append_pair( - "includeSourceRename", - &include_source_rename.to_string(), - ); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(orderby) = &this.orderby { - req.url_mut() - .query_pairs_mut() - .append_pair("$orderby", orderby); - } - if let Some(search_criteria_author) = &this.search_criteria_author { - req.url_mut() - .query_pairs_mut() - .append_pair("searchCriteria.author", search_criteria_author); - } - if let Some(search_criteria_follow_renames) = - &this.search_criteria_follow_renames - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.followRenames", - &search_criteria_follow_renames.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); - } - if let Some(search_criteria_from_id) = &this.search_criteria_from_id { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.fromId", - &search_criteria_from_id.to_string(), - ); - } - if let Some(search_criteria_include_links) = - &this.search_criteria_include_links - { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.includeLinks", - &search_criteria_include_links.to_string(), - ); - } - if let Some(search_criteria_item_path) = &this.search_criteria_item_path { - req.url_mut() - .query_pairs_mut() - .append_pair("searchCriteria.itemPath", search_criteria_item_path); - } - 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); - } - if let Some(search_criteria_to_id) = &this.search_criteria_to_id { - req.url_mut().query_pairs_mut().append_pair( - "searchCriteria.toId", - &search_criteria_to_id.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/changesets/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3143,14 +3591,18 @@ pub mod labels { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) label_id: String, pub(crate) top: Option, pub(crate) skip: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Max number of items to return"] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -3161,6 +3613,45 @@ pub mod labels { self.skip = Some(skip); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/tfvc/labels/{}/items", + self.client.endpoint(), + self.organization, + self.label_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3169,9 +3660,7 @@ pub mod labels { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3183,35 +3672,24 @@ pub mod labels { auth_header, ); } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/tfvc/labels/{}/items", - self.client.endpoint(), - self.organization, - self.label_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3261,8 +3739,12 @@ pub mod labels { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) request_data_include_links: Option, @@ -3274,7 +3756,7 @@ pub mod labels { pub(crate) top: Option, pub(crate) skip: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Whether to include the _links field on the shallow references"] pub fn request_data_include_links(mut self, request_data_include_links: bool) -> Self { self.request_data_include_links = Some(request_data_include_links); @@ -3321,6 +3803,78 @@ pub mod labels { self.skip = Some(skip); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(request_data_include_links) = &this.request_data_include_links { + req.url_mut().query_pairs_mut().append_pair( + "requestData.includeLinks", + &request_data_include_links.to_string(), + ); + } + if let Some(request_data_item_label_filter) = &this.request_data_item_label_filter { + req.url_mut().query_pairs_mut().append_pair( + "requestData.itemLabelFilter", + request_data_item_label_filter, + ); + } + if let Some(request_data_label_scope) = &this.request_data_label_scope { + req.url_mut() + .query_pairs_mut() + .append_pair("requestData.labelScope", request_data_label_scope); + } + if let Some(request_data_max_item_count) = &this.request_data_max_item_count { + req.url_mut().query_pairs_mut().append_pair( + "requestData.maxItemCount", + &request_data_max_item_count.to_string(), + ); + } + if let Some(request_data_name) = &this.request_data_name { + req.url_mut() + .query_pairs_mut() + .append_pair("requestData.name", request_data_name); + } + if let Some(request_data_owner) = &this.request_data_owner { + req.url_mut() + .query_pairs_mut() + .append_pair("requestData.owner", request_data_owner); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/labels", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3329,9 +3883,7 @@ pub mod labels { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3343,71 +3895,24 @@ pub mod labels { auth_header, ); } - if let Some(request_data_include_links) = &this.request_data_include_links { - req.url_mut().query_pairs_mut().append_pair( - "requestData.includeLinks", - &request_data_include_links.to_string(), - ); - } - if let Some(request_data_item_label_filter) = - &this.request_data_item_label_filter - { - req.url_mut().query_pairs_mut().append_pair( - "requestData.itemLabelFilter", - request_data_item_label_filter, - ); - } - if let Some(request_data_label_scope) = &this.request_data_label_scope { - req.url_mut() - .query_pairs_mut() - .append_pair("requestData.labelScope", request_data_label_scope); - } - if let Some(request_data_max_item_count) = &this.request_data_max_item_count - { - req.url_mut().query_pairs_mut().append_pair( - "requestData.maxItemCount", - &request_data_max_item_count.to_string(), - ); - } - if let Some(request_data_name) = &this.request_data_name { - req.url_mut() - .query_pairs_mut() - .append_pair("requestData.name", request_data_name); - } - if let Some(request_data_owner) = &this.request_data_owner { - req.url_mut() - .query_pairs_mut() - .append_pair("requestData.owner", request_data_owner); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/labels", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3457,8 +3962,12 @@ pub mod labels { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) label_id: String, pub(crate) project: String, @@ -3469,7 +3978,7 @@ pub mod labels { pub(crate) request_data_name: Option, pub(crate) request_data_owner: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Whether to include the _links field on the shallow references"] pub fn request_data_include_links(mut self, request_data_include_links: bool) -> Self { self.request_data_include_links = Some(request_data_include_links); @@ -3506,6 +4015,69 @@ pub mod labels { self.request_data_owner = Some(request_data_owner.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(request_data_include_links) = &this.request_data_include_links { + req.url_mut().query_pairs_mut().append_pair( + "requestData.includeLinks", + &request_data_include_links.to_string(), + ); + } + if let Some(request_data_item_label_filter) = &this.request_data_item_label_filter { + req.url_mut().query_pairs_mut().append_pair( + "requestData.itemLabelFilter", + request_data_item_label_filter, + ); + } + if let Some(request_data_label_scope) = &this.request_data_label_scope { + req.url_mut() + .query_pairs_mut() + .append_pair("requestData.labelScope", request_data_label_scope); + } + if let Some(request_data_max_item_count) = &this.request_data_max_item_count { + req.url_mut().query_pairs_mut().append_pair( + "requestData.maxItemCount", + &request_data_max_item_count.to_string(), + ); + } + if let Some(request_data_name) = &this.request_data_name { + req.url_mut() + .query_pairs_mut() + .append_pair("requestData.name", request_data_name); + } + if let Some(request_data_owner) = &this.request_data_owner { + req.url_mut() + .query_pairs_mut() + .append_pair("requestData.owner", request_data_owner); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/tfvc/labels/{}", + self.client.endpoint(), + self.organization, + self.project, + self.label_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3514,9 +4086,7 @@ pub mod labels { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3528,62 +4098,24 @@ pub mod labels { auth_header, ); } - if let Some(request_data_include_links) = &this.request_data_include_links { - req.url_mut().query_pairs_mut().append_pair( - "requestData.includeLinks", - &request_data_include_links.to_string(), - ); - } - if let Some(request_data_item_label_filter) = - &this.request_data_item_label_filter - { - req.url_mut().query_pairs_mut().append_pair( - "requestData.itemLabelFilter", - request_data_item_label_filter, - ); - } - if let Some(request_data_label_scope) = &this.request_data_label_scope { - req.url_mut() - .query_pairs_mut() - .append_pair("requestData.labelScope", request_data_label_scope); - } - if let Some(request_data_max_item_count) = &this.request_data_max_item_count - { - req.url_mut().query_pairs_mut().append_pair( - "requestData.maxItemCount", - &request_data_max_item_count.to_string(), - ); - } - if let Some(request_data_name) = &this.request_data_name { - req.url_mut() - .query_pairs_mut() - .append_pair("requestData.name", request_data_name); - } - if let Some(request_data_owner) = &this.request_data_owner { - req.url_mut() - .query_pairs_mut() - .append_pair("requestData.owner", request_data_owner); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/tfvc/labels/{}", - self.client.endpoint(), - self.organization, - self.project, - self.label_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3600,3 +4132,499 @@ pub mod labels { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn branches_client(&self) -> branches::Client { + branches::Client(self.clone()) + } + pub fn changesets_client(&self) -> changesets::Client { + changesets::Client(self.clone()) + } + pub fn items_client(&self) -> items::Client { + items::Client(self.clone()) + } + pub fn labels_client(&self) -> labels::Client { + labels::Client(self.clone()) + } + pub fn shelvesets_client(&self) -> shelvesets::Client { + shelvesets::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod shelvesets { + use super::super::models; + use super::super::shelvesets::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Return a collection of shallow shelveset references."] + #[doc = ""] + #[doc = "See [`list`](super::super::shelvesets::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + request_data_include_details: None, + request_data_include_links: None, + request_data_include_work_items: None, + request_data_max_change_count: None, + request_data_max_comment_length: None, + request_data_name: None, + request_data_owner: None, + top: None, + skip: None, + } + } + #[doc = "Get a single deep shelveset."] + #[doc = ""] + #[doc = "See [`get`](super::super::shelvesets::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + shelveset_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + shelveset_id: shelveset_id.into(), + request_data_include_details: None, + request_data_include_links: None, + request_data_include_work_items: None, + request_data_max_change_count: None, + request_data_max_comment_length: None, + request_data_name: None, + request_data_owner: None, + } + } + #[doc = "Get changes included in a shelveset."] + #[doc = ""] + #[doc = "See [`get_shelveset_changes`](super::super::shelvesets::Client::get_shelveset_changes) for details of the arguments."] + pub fn get_shelveset_changes( + &self, + organization: impl Into, + shelveset_id: impl Into, + ) -> get_shelveset_changes::RequestBuilder { + get_shelveset_changes::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + shelveset_id: shelveset_id.into(), + top: None, + skip: None, + } + } + #[doc = "Get work items associated with a shelveset."] + #[doc = ""] + #[doc = "See [`get_shelveset_work_items`](super::super::shelvesets::Client::get_shelveset_work_items) for details of the arguments."] + pub fn get_shelveset_work_items( + &self, + organization: impl Into, + shelveset_id: impl Into, + ) -> get_shelveset_work_items::RequestBuilder { + get_shelveset_work_items::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + shelveset_id: shelveset_id.into(), + } + } + } + } + pub mod branches { + use super::super::branches::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a single branch hierarchy at the given path with parents or children as specified."] + #[doc = ""] + #[doc = "See [`get`](super::super::branches::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + path: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + path: path.into(), + project: project.into(), + include_parent: None, + include_children: None, + } + } + #[doc = "Get a collection of branch roots -- first-level children, branches with no parents."] + #[doc = ""] + #[doc = "See [`get_branches`](super::super::branches::Client::get_branches) for details of the arguments."] + pub fn get_branches( + &self, + organization: impl Into, + project: impl Into, + ) -> get_branches::RequestBuilder { + get_branches::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + include_parent: None, + include_children: None, + include_deleted: None, + include_links: None, + } + } + #[doc = "Get branch hierarchies below the specified scopePath"] + #[doc = ""] + #[doc = "See [`get_branch_refs`](super::super::branches::Client::get_branch_refs) for details of the arguments."] + pub fn get_branch_refs( + &self, + organization: impl Into, + scope_path: impl Into, + project: impl Into, + ) -> get_branch_refs::RequestBuilder { + get_branch_refs::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + scope_path: scope_path.into(), + project: project.into(), + include_deleted: None, + include_links: None, + } + } + } + } + pub mod items { + use super::super::items::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download."] + #[doc = ""] + #[doc = "See [`get`](super::super::items::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + path: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + path: path.into(), + project: project.into(), + file_name: None, + download: None, + scope_path: None, + recursion_level: None, + version_descriptor_version: None, + version_descriptor_version_option: None, + version_descriptor_version_type: None, + include_content: None, + } + } + #[doc = "Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path."] + #[doc = ""] + #[doc = "See [`get_items_batch`](super::super::items::Client::get_items_batch) for details of the arguments."] + pub fn get_items_batch( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> get_items_batch::RequestBuilder { + get_items_batch::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get a list of Tfvc items"] + #[doc = ""] + #[doc = "See [`list`](super::super::items::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + scope_path: None, + recursion_level: None, + include_links: None, + version_descriptor_version: None, + version_descriptor_version_option: None, + version_descriptor_version_type: None, + } + } + } + } + pub mod changesets { + use super::super::changesets::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Retrieve Tfvc changes for a given changeset."] + #[doc = ""] + #[doc = "See [`get_changeset_changes`](super::super::changesets::Client::get_changeset_changes) for details of the arguments."] + pub fn get_changeset_changes( + &self, + organization: impl Into, + id: i32, + ) -> get_changeset_changes::RequestBuilder { + get_changeset_changes::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + skip: None, + top: None, + continuation_token: None, + } + } + #[doc = "Retrieves the work items associated with a particular changeset."] + #[doc = ""] + #[doc = "See [`get_changeset_work_items`](super::super::changesets::Client::get_changeset_work_items) for details of the arguments."] + pub fn get_changeset_work_items( + &self, + organization: impl Into, + id: i32, + ) -> get_changeset_work_items::RequestBuilder { + get_changeset_work_items::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + } + } + #[doc = "Returns changesets for a given list of changeset Ids."] + #[doc = ""] + #[doc = "See [`get_batched_changesets`](super::super::changesets::Client::get_batched_changesets) for details of the arguments."] + pub fn get_batched_changesets( + &self, + organization: impl Into, + body: impl Into, + ) -> get_batched_changesets::RequestBuilder { + get_batched_changesets::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Retrieve Tfvc Changesets\n\nNote: This is a new version of the GetChangesets API that doesn't expose the unneeded queryParams\npresent in the 1.0 version of the API."] + #[doc = ""] + #[doc = "See [`get_changesets`](super::super::changesets::Client::get_changesets) for details of the arguments."] + pub fn get_changesets( + &self, + organization: impl Into, + project: impl Into, + ) -> get_changesets::RequestBuilder { + get_changesets::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + max_comment_length: None, + skip: None, + top: None, + orderby: None, + search_criteria_author: None, + search_criteria_follow_renames: None, + search_criteria_from_date: None, + search_criteria_from_id: None, + search_criteria_include_links: None, + search_criteria_item_path: None, + search_criteria_mappings: Vec::new(), + search_criteria_to_date: None, + search_criteria_to_id: None, + } + } + #[doc = "Create a new changeset.\n\nAccepts TfvcChangeset as JSON body"] + #[doc = ""] + #[doc = "See [`create`](super::super::changesets::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Retrieve a Tfvc Changeset"] + #[doc = ""] + #[doc = "See [`get`](super::super::changesets::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + id: i32, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + project: project.into(), + max_change_count: None, + include_details: None, + include_work_items: None, + max_comment_length: None, + include_source_rename: None, + skip: None, + top: None, + orderby: None, + search_criteria_author: None, + search_criteria_follow_renames: None, + search_criteria_from_date: None, + search_criteria_from_id: None, + search_criteria_include_links: None, + search_criteria_item_path: None, + search_criteria_mappings: Vec::new(), + search_criteria_to_date: None, + search_criteria_to_id: None, + } + } + } + } + pub mod labels { + use super::super::labels::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get items under a label."] + #[doc = ""] + #[doc = "See [`get_label_items`](super::super::labels::Client::get_label_items) for details of the arguments."] + pub fn get_label_items( + &self, + organization: impl Into, + label_id: impl Into, + ) -> get_label_items::RequestBuilder { + get_label_items::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + label_id: label_id.into(), + top: None, + skip: None, + } + } + #[doc = "Get a collection of shallow label references."] + #[doc = ""] + #[doc = "See [`list`](super::super::labels::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + request_data_include_links: None, + request_data_item_label_filter: None, + request_data_label_scope: None, + request_data_max_item_count: None, + request_data_name: None, + request_data_owner: None, + top: None, + skip: None, + } + } + #[doc = "Get a single deep label."] + #[doc = ""] + #[doc = "See [`get`](super::super::labels::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + label_id: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + label_id: label_id.into(), + project: project.into(), + request_data_include_links: None, + request_data_item_label_filter: None, + request_data_label_scope: None, + request_data_max_item_count: None, + request_data_name: None, + request_data_owner: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/token_admin/mod.rs b/azure_devops_rust_api/src/token_admin/mod.rs index 43532c90..010cd4d4 100644 --- a/azure_devops_rust_api/src/token_admin/mod.rs +++ b/azure_devops_rust_api/src/token_admin/mod.rs @@ -205,15 +205,19 @@ pub mod personal_access_tokens { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) subject_descriptor: String, pub(crate) page_size: Option, pub(crate) continuation_token: Option, pub(crate) is_public: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The maximum number of results to return on each page."] pub fn page_size(mut self, page_size: i32) -> Self { self.page_size = Some(page_size); @@ -229,6 +233,50 @@ pub mod personal_access_tokens { self.is_public = Some(is_public); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(page_size) = &this.page_size { + req.url_mut() + .query_pairs_mut() + .append_pair("pageSize", &page_size.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(is_public) = &this.is_public { + req.url_mut() + .query_pairs_mut() + .append_pair("isPublic", &is_public.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/tokenadmin/personalaccesstokens/{}", + self.client.endpoint(), + self.organization, + self.subject_descriptor + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -237,9 +285,7 @@ pub mod personal_access_tokens { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -251,40 +297,24 @@ pub mod personal_access_tokens { auth_header, ); } - if let Some(page_size) = &this.page_size { - req.url_mut() - .query_pairs_mut() - .append_pair("pageSize", &page_size.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(is_public) = &this.is_public { - req.url_mut() - .query_pairs_mut() - .append_pair("isPublic", &is_public.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/tokenadmin/personalaccesstokens/{}", - self.client.endpoint(), - self.organization, - self.subject_descriptor - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -356,11 +386,43 @@ pub mod revocation_rules { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TokenAdminRevocationRule, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -370,9 +432,7 @@ pub mod revocation_rules { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -384,25 +444,24 @@ pub mod revocation_rules { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -477,18 +536,56 @@ pub mod revocations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) is_public: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Set to false for PAT tokens and true for SSH tokens."] pub fn is_public(mut self, is_public: bool) -> Self { self.is_public = Some(is_public); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -497,9 +594,7 @@ pub mod revocations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -511,30 +606,24 @@ pub mod revocations { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -554,3 +643,158 @@ pub mod revocations { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn personal_access_tokens_client(&self) -> personal_access_tokens::Client { + personal_access_tokens::Client(self.clone()) + } + pub fn revocation_rules_client(&self) -> revocation_rules::Client { + revocation_rules::Client(self.clone()) + } + pub fn revocations_client(&self) -> revocations::Client { + revocations::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod personal_access_tokens { + use super::super::models; + use super::super::personal_access_tokens::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Lists of all the session token details of the personal access tokens (PATs) for a particular user."] + #[doc = ""] + #[doc = "See [`list`](super::super::personal_access_tokens::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + subject_descriptor: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + subject_descriptor: subject_descriptor.into(), + page_size: None, + continuation_token: None, + is_public: None, + } + } + } + } + pub mod revocation_rules { + use super::super::models; + use super::super::revocation_rules::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Creates a revocation rule to prevent the further usage of any OAuth authorizations that were created before the current point in time and which match the conditions in the rule.\n\nNot all kinds of OAuth authorizations can be revoked directly.\nSome, such as self-describing session tokens, must instead by revoked by creating a rule\nwhich will be evaluated and used to reject matching OAuth credentials at authentication time.\nRevocation rules created through this endpoint will apply to all credentials that were issued\nbefore the datetime at which the rule was created and which match one or more additional conditions."] + #[doc = ""] + #[doc = "See [`create`](super::super::revocation_rules::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + } + } + pub mod revocations { + use super::super::models; + use super::super::revocations::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Revokes the listed OAuth authorizations."] + #[doc = ""] + #[doc = "See [`revoke_authorizations`](super::super::revocations::Client::revoke_authorizations) for details of the arguments."] + pub fn revoke_authorizations( + &self, + organization: impl Into, + body: Vec, + ) -> revoke_authorizations::RequestBuilder { + revoke_authorizations::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + is_public: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/tokens/mod.rs b/azure_devops_rust_api/src/tokens/mod.rs index 6fb1e64d..d65766fe 100644 --- a/azure_devops_rust_api/src/tokens/mod.rs +++ b/azure_devops_rust_api/src/tokens/mod.rs @@ -254,8 +254,12 @@ pub mod pats { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) display_filter_option: Option, pub(crate) sort_by_option: Option, @@ -263,7 +267,7 @@ pub mod pats { pub(crate) continuation_token: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "(Optional) Refers to the status of the personal access token (PAT)"] pub fn display_filter_option( mut self, @@ -295,6 +299,59 @@ pub mod pats { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(display_filter_option) = &this.display_filter_option { + req.url_mut() + .query_pairs_mut() + .append_pair("displayFilterOption", &display_filter_option.to_string()); + } + if let Some(sort_by_option) = &this.sort_by_option { + req.url_mut() + .query_pairs_mut() + .append_pair("sortByOption", &sort_by_option.to_string()); + } + if let Some(is_sort_ascending) = &this.is_sort_ascending { + req.url_mut() + .query_pairs_mut() + .append_pair("isSortAscending", &is_sort_ascending.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -303,9 +360,7 @@ pub mod pats { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -317,50 +372,24 @@ pub mod pats { auth_header, ); } - if let Some(display_filter_option) = &this.display_filter_option { - req.url_mut().query_pairs_mut().append_pair( - "displayFilterOption", - &display_filter_option.to_string(), - ); - } - if let Some(sort_by_option) = &this.sort_by_option { - req.url_mut() - .query_pairs_mut() - .append_pair("sortByOption", &sort_by_option.to_string()); - } - if let Some(is_sort_ascending) = &this.is_sort_ascending { - req.url_mut() - .query_pairs_mut() - .append_pair("isSortAscending", &is_sort_ascending.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -410,11 +439,46 @@ pub mod pats { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) authorization_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let authorization_id = &this.authorization_id; + req.url_mut() + .query_pairs_mut() + .append_pair("authorizationId", authorization_id); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -424,9 +488,7 @@ pub mod pats { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -438,28 +500,24 @@ pub mod pats { auth_header, ); } - let authorization_id = &this.authorization_id; - req.url_mut() - .query_pairs_mut() - .append_pair("authorizationId", authorization_id); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -509,11 +567,43 @@ pub mod pats { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PatTokenCreateRequest, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -523,9 +613,7 @@ pub mod pats { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -537,25 +625,24 @@ pub mod pats { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -605,11 +692,43 @@ pub mod pats { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::PatTokenUpdateRequest, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -619,9 +738,7 @@ pub mod pats { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -633,25 +750,24 @@ pub mod pats { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -696,11 +812,46 @@ pub mod pats { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) authorization_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let authorization_id = &this.authorization_id; + req.url_mut() + .query_pairs_mut() + .append_pair("authorizationId", authorization_id); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -710,9 +861,7 @@ pub mod pats { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -724,28 +873,24 @@ pub mod pats { auth_header, ); } - let authorization_id = &this.authorization_id; - req.url_mut() - .query_pairs_mut() - .append_pair("authorizationId", authorization_id); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -765,3 +910,165 @@ pub mod pats { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn pats_client(&self) -> pats::Client { + pats::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod pats { + use super::super::models; + use super::super::pats::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets a paged list of personal access tokens (PATs) created in this organization. Subsequent calls to the API require the same filtering options to be supplied."] + #[doc = ""] + #[doc = "See [`list`](super::super::pats::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + display_filter_option: None, + sort_by_option: None, + is_sort_ascending: None, + continuation_token: None, + top: None, + } + } + #[doc = "Gets a single personal access token (PAT)."] + #[doc = ""] + #[doc = "See [`get`](super::super::pats::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + authorization_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + authorization_id: authorization_id.into(), + } + } + #[doc = "Creates a new personal access token (PAT) for the requesting user."] + #[doc = ""] + #[doc = "See [`create`](super::super::pats::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Updates an existing personal access token (PAT) with the new parameters. To update a token, it must be valid (has not been revoked)."] + #[doc = ""] + #[doc = "See [`update`](super::super::pats::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + } + } + #[doc = "Revokes a personal access token (PAT) by authorizationId."] + #[doc = ""] + #[doc = "See [`revoke`](super::super::pats::Client::revoke) for details of the arguments."] + pub fn revoke( + &self, + organization: impl Into, + authorization_id: impl Into, + ) -> revoke::RequestBuilder { + revoke::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + authorization_id: authorization_id.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/src/wiki/mod.rs b/azure_devops_rust_api/src/wiki/mod.rs index 405cbb4e..f03fc459 100644 --- a/azure_devops_rust_api/src/wiki/mod.rs +++ b/azure_devops_rust_api/src/wiki/mod.rs @@ -287,11 +287,43 @@ pub mod wikis { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -301,9 +333,7 @@ pub mod wikis { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -315,25 +345,24 @@ pub mod wikis { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -383,12 +412,45 @@ pub mod wikis { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WikiCreateParametersV2, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -398,9 +460,7 @@ pub mod wikis { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -412,26 +472,24 @@ pub mod wikis { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -481,12 +539,45 @@ pub mod wikis { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) wiki_identifier: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}", + self.client.endpoint(), + self.organization, + self.project, + self.wiki_identifier + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -496,9 +587,7 @@ pub mod wikis { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -510,26 +599,24 @@ pub mod wikis { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}", - self.client.endpoint(), - self.organization, - self.project, - self.wiki_identifier - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -579,13 +666,47 @@ pub mod wikis { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WikiUpdateParameters, pub(crate) wiki_identifier: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}", + self.client.endpoint(), + self.organization, + self.project, + self.wiki_identifier + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -595,9 +716,7 @@ pub mod wikis { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -609,27 +728,24 @@ pub mod wikis { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}", - self.client.endpoint(), - self.organization, - self.project, - self.wiki_identifier - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -679,12 +795,45 @@ pub mod wikis { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) wiki_identifier: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}", + self.client.endpoint(), + self.organization, + self.project, + self.wiki_identifier + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -694,9 +843,7 @@ pub mod wikis { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -708,26 +855,24 @@ pub mod wikis { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}", - self.client.endpoint(), - self.organization, - self.project, - self.wiki_identifier - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -825,8 +970,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: String, pub(crate) project: String, @@ -836,7 +985,7 @@ pub mod attachments { pub(crate) version_descriptor_version_options: Option, pub(crate) version_descriptor_version_type: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] pub fn version_descriptor_version( mut self, @@ -862,6 +1011,59 @@ pub mod attachments { self.version_descriptor_version_type = Some(version_descriptor_version_type.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/octet-stream"); + 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 { + req.url_mut() + .query_pairs_mut() + .append_pair("versionDescriptor.version", version_descriptor_version); + } + if let Some(version_descriptor_version_options) = + &this.version_descriptor_version_options + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionOptions", + &version_descriptor_version_options.to_string(), + ); + } + if let Some(version_descriptor_version_type) = &this.version_descriptor_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionType", + &version_descriptor_version_type.to_string(), + ); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/attachments", + self.client.endpoint(), + self.organization, + self.project, + self.wiki_identifier + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -870,9 +1072,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -884,51 +1084,24 @@ pub mod attachments { auth_header, ); } - req.insert_header("content-type", "application/octet-stream"); - 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 { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.version", - version_descriptor_version, - ); - } - if let Some(version_descriptor_version_options) = - &this.version_descriptor_version_options - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionOptions", - &version_descriptor_version_options.to_string(), - ); - } - if let Some(version_descriptor_version_type) = - &this.version_descriptor_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionType", - &version_descriptor_version_type.to_string(), - ); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/attachments", - self.client.endpoint(), - self.organization, - self.project, - self.wiki_identifier - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1024,8 +1197,12 @@ pub mod page_moves { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WikiPageMoveParameters, pub(crate) project: String, @@ -1035,7 +1212,7 @@ pub mod page_moves { pub(crate) version_descriptor_version_options: Option, pub(crate) version_descriptor_version_type: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Comment that is to be associated with this page move."] pub fn comment(mut self, comment: impl Into) -> Self { self.comment = Some(comment.into()); @@ -1066,6 +1243,62 @@ pub mod page_moves { self.version_descriptor_version_type = Some(version_descriptor_version_type.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + if let Some(comment) = &this.comment { + req.url_mut() + .query_pairs_mut() + .append_pair("comment", comment); + } + if let Some(version_descriptor_version) = &this.version_descriptor_version { + req.url_mut() + .query_pairs_mut() + .append_pair("versionDescriptor.version", version_descriptor_version); + } + if let Some(version_descriptor_version_options) = + &this.version_descriptor_version_options + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionOptions", + &version_descriptor_version_options.to_string(), + ); + } + if let Some(version_descriptor_version_type) = &this.version_descriptor_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionType", + &version_descriptor_version_type.to_string(), + ); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pagemoves", + self.client.endpoint(), + self.organization, + self.project, + self.wiki_identifier + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1074,9 +1307,7 @@ pub mod page_moves { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1088,54 +1319,24 @@ pub mod page_moves { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - if let Some(comment) = &this.comment { - req.url_mut() - .query_pairs_mut() - .append_pair("comment", comment); - } - if let Some(version_descriptor_version) = &this.version_descriptor_version { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.version", - version_descriptor_version, - ); - } - if let Some(version_descriptor_version_options) = - &this.version_descriptor_version_options - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionOptions", - &version_descriptor_version_options.to_string(), - ); - } - if let Some(version_descriptor_version_type) = - &this.version_descriptor_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionType", - &version_descriptor_version_type.to_string(), - ); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pagemoves", - self.client.endpoint(), - self.organization, - self.project, - self.wiki_identifier - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1364,8 +1565,12 @@ pub mod pages { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) wiki_identifier: String, @@ -1376,7 +1581,7 @@ pub mod pages { pub(crate) version_descriptor_version_type: Option, pub(crate) include_content: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Wiki page path."] pub fn path(mut self, path: impl Into) -> Self { self.path = Some(path.into()); @@ -1420,6 +1625,69 @@ pub mod pages { self.include_content = Some(include_content); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(path) = &this.path { + req.url_mut().query_pairs_mut().append_pair("path", path); + } + if let Some(recursion_level) = &this.recursion_level { + req.url_mut() + .query_pairs_mut() + .append_pair("recursionLevel", &recursion_level.to_string()); + } + if let Some(version_descriptor_version) = &this.version_descriptor_version { + req.url_mut() + .query_pairs_mut() + .append_pair("versionDescriptor.version", version_descriptor_version); + } + if let Some(version_descriptor_version_options) = + &this.version_descriptor_version_options + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionOptions", + &version_descriptor_version_options.to_string(), + ); + } + if let Some(version_descriptor_version_type) = &this.version_descriptor_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionType", + &version_descriptor_version_type.to_string(), + ); + } + if let Some(include_content) = &this.include_content { + req.url_mut() + .query_pairs_mut() + .append_pair("includeContent", &include_content.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages", + self.client.endpoint(), + self.organization, + self.project, + self.wiki_identifier + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1428,9 +1696,7 @@ pub mod pages { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1442,61 +1708,24 @@ pub mod pages { auth_header, ); } - if let Some(path) = &this.path { - req.url_mut().query_pairs_mut().append_pair("path", path); - } - if let Some(recursion_level) = &this.recursion_level { - req.url_mut() - .query_pairs_mut() - .append_pair("recursionLevel", &recursion_level.to_string()); - } - if let Some(version_descriptor_version) = &this.version_descriptor_version { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.version", - version_descriptor_version, - ); - } - if let Some(version_descriptor_version_options) = - &this.version_descriptor_version_options - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionOptions", - &version_descriptor_version_options.to_string(), - ); - } - if let Some(version_descriptor_version_type) = - &this.version_descriptor_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionType", - &version_descriptor_version_type.to_string(), - ); - } - if let Some(include_content) = &this.include_content { - req.url_mut() - .query_pairs_mut() - .append_pair("includeContent", &include_content.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages", - self.client.endpoint(), - self.organization, - self.project, - self.wiki_identifier - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1556,8 +1785,12 @@ pub mod pages { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WikiPageCreateOrUpdateParameters, pub(crate) project: String, @@ -1569,7 +1802,7 @@ pub mod pages { pub(crate) version_descriptor_version_options: Option, pub(crate) version_descriptor_version_type: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Comment to be associated with the page operation."] pub fn comment(mut self, comment: impl Into) -> Self { self.comment = Some(comment.into()); @@ -1600,6 +1833,65 @@ pub mod pages { self.version_descriptor_version_type = Some(version_descriptor_version_type.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + 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); + if let Some(comment) = &this.comment { + req.url_mut() + .query_pairs_mut() + .append_pair("comment", comment); + } + if let Some(version_descriptor_version) = &this.version_descriptor_version { + req.url_mut() + .query_pairs_mut() + .append_pair("versionDescriptor.version", version_descriptor_version); + } + if let Some(version_descriptor_version_options) = + &this.version_descriptor_version_options + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionOptions", + &version_descriptor_version_options.to_string(), + ); + } + if let Some(version_descriptor_version_type) = &this.version_descriptor_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionType", + &version_descriptor_version_type.to_string(), + ); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages", + self.client.endpoint(), + self.organization, + self.project, + self.wiki_identifier + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1608,9 +1900,7 @@ pub mod pages { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1622,57 +1912,24 @@ pub mod pages { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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); - if let Some(comment) = &this.comment { - req.url_mut() - .query_pairs_mut() - .append_pair("comment", comment); - } - if let Some(version_descriptor_version) = &this.version_descriptor_version { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.version", - version_descriptor_version, - ); - } - if let Some(version_descriptor_version_options) = - &this.version_descriptor_version_options - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionOptions", - &version_descriptor_version_options.to_string(), - ); - } - if let Some(version_descriptor_version_type) = - &this.version_descriptor_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionType", - &version_descriptor_version_type.to_string(), - ); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages", - self.client.endpoint(), - self.organization, - self.project, - self.wiki_identifier - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1732,8 +1989,12 @@ pub mod pages { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) wiki_identifier: String, @@ -1743,7 +2004,7 @@ pub mod pages { pub(crate) version_descriptor_version_options: Option, pub(crate) version_descriptor_version_type: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Comment to be associated with this page delete."] pub fn comment(mut self, comment: impl Into) -> Self { self.comment = Some(comment.into()); @@ -1774,6 +2035,63 @@ pub mod pages { self.version_descriptor_version_type = Some(version_descriptor_version_type.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let path = &this.path; + req.url_mut().query_pairs_mut().append_pair("path", path); + if let Some(comment) = &this.comment { + req.url_mut() + .query_pairs_mut() + .append_pair("comment", comment); + } + if let Some(version_descriptor_version) = &this.version_descriptor_version { + req.url_mut() + .query_pairs_mut() + .append_pair("versionDescriptor.version", version_descriptor_version); + } + if let Some(version_descriptor_version_options) = + &this.version_descriptor_version_options + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionOptions", + &version_descriptor_version_options.to_string(), + ); + } + if let Some(version_descriptor_version_type) = &this.version_descriptor_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionType", + &version_descriptor_version_type.to_string(), + ); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages", + self.client.endpoint(), + self.organization, + self.project, + self.wiki_identifier + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1782,9 +2100,7 @@ pub mod pages { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1796,55 +2112,24 @@ pub mod pages { auth_header, ); } - let path = &this.path; - req.url_mut().query_pairs_mut().append_pair("path", path); - if let Some(comment) = &this.comment { - req.url_mut() - .query_pairs_mut() - .append_pair("comment", comment); - } - if let Some(version_descriptor_version) = &this.version_descriptor_version { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.version", - version_descriptor_version, - ); - } - if let Some(version_descriptor_version_options) = - &this.version_descriptor_version_options - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionOptions", - &version_descriptor_version_options.to_string(), - ); - } - if let Some(version_descriptor_version_type) = - &this.version_descriptor_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionType", - &version_descriptor_version_type.to_string(), - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages", - self.client.endpoint(), - self.organization, - self.project, - self.wiki_identifier - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1904,8 +2189,12 @@ pub mod pages { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) wiki_identifier: String, @@ -1913,7 +2202,7 @@ pub mod pages { pub(crate) recursion_level: Option, pub(crate) include_content: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Recursion level for subpages retrieval. Defaults to `None` (Optional)."] pub fn recursion_level( mut self, @@ -1927,6 +2216,47 @@ pub mod pages { self.include_content = Some(include_content); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(recursion_level) = &this.recursion_level { + req.url_mut() + .query_pairs_mut() + .append_pair("recursionLevel", &recursion_level.to_string()); + } + if let Some(include_content) = &this.include_content { + req.url_mut() + .query_pairs_mut() + .append_pair("includeContent", &include_content.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", + self.client.endpoint(), + self.organization, + self.project, + self.wiki_identifier, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1935,9 +2265,7 @@ pub mod pages { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1949,37 +2277,24 @@ pub mod pages { auth_header, ); } - if let Some(recursion_level) = &this.recursion_level { - req.url_mut() - .query_pairs_mut() - .append_pair("recursionLevel", &recursion_level.to_string()); - } - if let Some(include_content) = &this.include_content { - req.url_mut() - .query_pairs_mut() - .append_pair("includeContent", &include_content.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", - self.client.endpoint(), - self.organization, - self.project, - self.wiki_identifier, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2039,8 +2354,12 @@ pub mod pages { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WikiPageCreateOrUpdateParameters, pub(crate) project: String, @@ -2049,12 +2368,50 @@ pub mod pages { pub(crate) if_match: String, pub(crate) comment: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Comment to be associated with the page operation."] pub fn comment(mut self, comment: impl Into) -> Self { self.comment = Some(comment.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + 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() + .query_pairs_mut() + .append_pair("comment", comment); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", + self.client.endpoint(), + self.organization, + self.project, + self.wiki_identifier, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2063,9 +2420,7 @@ pub mod pages { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2077,34 +2432,24 @@ pub mod pages { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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() - .query_pairs_mut() - .append_pair("comment", comment); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", - self.client.endpoint(), - self.organization, - self.project, - self.wiki_identifier, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2164,20 +2509,60 @@ pub mod pages { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) wiki_identifier: String, pub(crate) id: i32, pub(crate) comment: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Comment to be associated with this page delete."] pub fn comment(mut self, comment: impl Into) -> Self { self.comment = Some(comment.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + if let Some(comment) = &this.comment { + req.url_mut() + .query_pairs_mut() + .append_pair("comment", comment); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", + self.client.endpoint(), + self.organization, + self.project, + self.wiki_identifier, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2186,9 +2571,7 @@ pub mod pages { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2200,32 +2583,24 @@ pub mod pages { auth_header, ); } - if let Some(comment) = &this.comment { - req.url_mut() - .query_pairs_mut() - .append_pair("comment", comment); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}", - self.client.endpoint(), - self.organization, - self.project, - self.wiki_identifier, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2308,20 +2683,60 @@ pub mod page_stats { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) wiki_identifier: String, pub(crate) page_id: i32, pub(crate) page_views_for_days: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "last N days from the current day for which page views is to be returned. It's inclusive of current day."] pub fn page_views_for_days(mut self, page_views_for_days: i32) -> Self { self.page_views_for_days = Some(page_views_for_days); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}/stats", + self.client.endpoint(), + self.organization, + self.project, + self.wiki_identifier, + self.page_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2330,9 +2745,7 @@ pub mod page_stats { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2344,32 +2757,24 @@ pub mod page_stats { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}/stats", - self.client.endpoint(), - self.organization, - self.project, - self.wiki_identifier, - self.page_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2454,8 +2859,12 @@ pub mod pages_batch { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WikiPagesBatchRequest, pub(crate) project: String, @@ -2464,7 +2873,7 @@ pub mod pages_batch { pub(crate) version_descriptor_version_options: Option, pub(crate) version_descriptor_version_type: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"] pub fn version_descriptor_version( mut self, @@ -2490,6 +2899,57 @@ pub mod pages_batch { self.version_descriptor_version_type = Some(version_descriptor_version_type.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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", version_descriptor_version); + } + if let Some(version_descriptor_version_options) = + &this.version_descriptor_version_options + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionOptions", + &version_descriptor_version_options.to_string(), + ); + } + if let Some(version_descriptor_version_type) = &this.version_descriptor_version_type + { + req.url_mut().query_pairs_mut().append_pair( + "versionDescriptor.versionType", + &version_descriptor_version_type.to_string(), + ); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wiki/wikis/{}/pagesbatch", + self.client.endpoint(), + self.organization, + self.project, + self.wiki_identifier + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -2498,9 +2958,7 @@ pub mod pages_batch { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2512,49 +2970,24 @@ pub mod pages_batch { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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", - version_descriptor_version, - ); - } - if let Some(version_descriptor_version_options) = - &this.version_descriptor_version_options - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionOptions", - &version_descriptor_version_options.to_string(), - ); - } - if let Some(version_descriptor_version_type) = - &this.version_descriptor_version_type - { - req.url_mut().query_pairs_mut().append_pair( - "versionDescriptor.versionType", - &version_descriptor_version_type.to_string(), - ); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wiki/wikis/{}/pagesbatch", - self.client.endpoint(), - self.organization, - self.project, - self.wiki_identifier - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2571,3 +3004,439 @@ pub mod pages_batch { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn attachments_client(&self) -> attachments::Client { + attachments::Client(self.clone()) + } + pub fn page_moves_client(&self) -> page_moves::Client { + page_moves::Client(self.clone()) + } + pub fn page_stats_client(&self) -> page_stats::Client { + page_stats::Client(self.clone()) + } + pub fn pages_client(&self) -> pages::Client { + pages::Client(self.clone()) + } + pub fn pages_batch_client(&self) -> pages_batch::Client { + pages_batch::Client(self.clone()) + } + pub fn wikis_client(&self) -> wikis::Client { + wikis::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod wikis { + use super::super::models; + use super::super::wikis::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets all wikis in a project or collection."] + #[doc = ""] + #[doc = "See [`list`](super::super::wikis::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Creates the wiki resource."] + #[doc = ""] + #[doc = "See [`create`](super::super::wikis::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Gets the wiki corresponding to the wiki ID or wiki name provided."] + #[doc = ""] + #[doc = "See [`get`](super::super::wikis::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + wiki_identifier: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + wiki_identifier: wiki_identifier.into(), + project: project.into(), + } + } + #[doc = "Updates the wiki corresponding to the wiki ID or wiki name provided using the update parameters."] + #[doc = ""] + #[doc = "See [`update`](super::super::wikis::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + wiki_identifier: impl Into, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + wiki_identifier: wiki_identifier.into(), + project: project.into(), + } + } + #[doc = "Deletes the wiki corresponding to the wiki ID or wiki name provided."] + #[doc = ""] + #[doc = "See [`delete`](super::super::wikis::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + wiki_identifier: impl Into, + project: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + wiki_identifier: wiki_identifier.into(), + project: project.into(), + } + } + } + } + pub mod attachments { + use super::super::attachments::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Creates an attachment in the wiki."] + #[doc = ""] + #[doc = "See [`create`](super::super::attachments::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + wiki_identifier: impl Into, + name: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + wiki_identifier: wiki_identifier.into(), + name: name.into(), + version_descriptor_version: None, + version_descriptor_version_options: None, + version_descriptor_version_type: None, + } + } + } + } + pub mod page_moves { + use super::super::models; + use super::super::page_moves::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Creates a page move operation that updates the path and order of the page as provided in the parameters."] + #[doc = ""] + #[doc = "See [`create`](super::super::page_moves::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + wiki_identifier: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + wiki_identifier: wiki_identifier.into(), + comment: None, + version_descriptor_version: None, + version_descriptor_version_options: None, + version_descriptor_version_type: None, + } + } + } + } + pub mod pages { + use super::super::models; + use super::super::pages::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request."] + #[doc = ""] + #[doc = "See [`get_page`](super::super::pages::Client::get_page) for details of the arguments."] + pub fn get_page( + &self, + organization: impl Into, + project: impl Into, + wiki_identifier: impl Into, + ) -> get_page::RequestBuilder { + get_page::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + wiki_identifier: wiki_identifier.into(), + path: None, + recursion_level: None, + version_descriptor_version: None, + version_descriptor_version_options: None, + version_descriptor_version_type: None, + include_content: None, + } + } + #[doc = "Creates or edits a wiki page."] + #[doc = ""] + #[doc = "See [`create_or_update`](super::super::pages::Client::create_or_update) for details of the arguments."] + pub fn create_or_update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + wiki_identifier: impl Into, + path: impl Into, + if_match: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + wiki_identifier: wiki_identifier.into(), + path: path.into(), + if_match: if_match.into(), + comment: None, + version_descriptor_version: None, + version_descriptor_version_options: None, + version_descriptor_version_type: None, + } + } + #[doc = "Deletes a wiki page."] + #[doc = ""] + #[doc = "See [`delete_page`](super::super::pages::Client::delete_page) for details of the arguments."] + pub fn delete_page( + &self, + organization: impl Into, + project: impl Into, + wiki_identifier: impl Into, + path: impl Into, + ) -> delete_page::RequestBuilder { + delete_page::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + wiki_identifier: wiki_identifier.into(), + path: path.into(), + comment: None, + version_descriptor_version: None, + version_descriptor_version_options: None, + version_descriptor_version_type: None, + } + } + #[doc = "Gets metadata or content of the wiki page for the provided page id. Content negotiation is done based on the `Accept` header sent in the request."] + #[doc = ""] + #[doc = "See [`get_page_by_id`](super::super::pages::Client::get_page_by_id) for details of the arguments."] + pub fn get_page_by_id( + &self, + organization: impl Into, + project: impl Into, + wiki_identifier: impl Into, + id: i32, + ) -> get_page_by_id::RequestBuilder { + get_page_by_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + wiki_identifier: wiki_identifier.into(), + id, + recursion_level: None, + include_content: None, + } + } + #[doc = "Edits a wiki page."] + #[doc = ""] + #[doc = "See [`update`](super::super::pages::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + wiki_identifier: impl Into, + id: i32, + if_match: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + wiki_identifier: wiki_identifier.into(), + id, + if_match: if_match.into(), + comment: None, + } + } + #[doc = "Deletes a wiki page."] + #[doc = ""] + #[doc = "See [`delete_page_by_id`](super::super::pages::Client::delete_page_by_id) for details of the arguments."] + pub fn delete_page_by_id( + &self, + organization: impl Into, + project: impl Into, + wiki_identifier: impl Into, + id: i32, + ) -> delete_page_by_id::RequestBuilder { + delete_page_by_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + wiki_identifier: wiki_identifier.into(), + id, + comment: None, + } + } + } + } + pub mod page_stats { + use super::super::models; + use super::super::page_stats::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns page detail corresponding to Page ID."] + #[doc = ""] + #[doc = "See [`get`](super::super::page_stats::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + wiki_identifier: impl Into, + page_id: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + wiki_identifier: wiki_identifier.into(), + page_id, + page_views_for_days: None, + } + } + } + } + pub mod pages_batch { + use super::super::models; + use super::super::pages_batch::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns pageable list of Wiki Pages"] + #[doc = ""] + #[doc = "See [`get`](super::super::pages_batch::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + wiki_identifier: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + wiki_identifier: wiki_identifier.into(), + version_descriptor_version: None, + version_descriptor_version_options: None, + version_descriptor_version_type: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/wit/mod.rs b/azure_devops_rust_api/src/wit/mod.rs index 937d3b83..3f587d46 100644 --- a/azure_devops_rust_api/src/wit/mod.rs +++ b/azure_devops_rust_api/src/wit/mod.rs @@ -410,15 +410,19 @@ pub mod classification_nodes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) ids: String, pub(crate) depth: Option, pub(crate) error_policy: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Depth of children to fetch."] pub fn depth(mut self, depth: i32) -> Self { self.depth = Some(depth); @@ -432,6 +436,48 @@ pub mod classification_nodes { self.error_policy = Some(error_policy.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let ids = &this.ids; + req.url_mut().query_pairs_mut().append_pair("ids", ids); + if let Some(depth) = &this.depth { + req.url_mut() + .query_pairs_mut() + .append_pair("$depth", &depth.to_string()); + } + if let Some(error_policy) = &this.error_policy { + req.url_mut() + .query_pairs_mut() + .append_pair("errorPolicy", &error_policy.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/classificationnodes?ids={}", + self.client.endpoint(), + self.organization, + self.project, + self.ids + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -440,9 +486,7 @@ pub mod classification_nodes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -454,38 +498,24 @@ pub mod classification_nodes { auth_header, ); } - let ids = &this.ids; - req.url_mut().query_pairs_mut().append_pair("ids", ids); - if let Some(depth) = &this.depth { - req.url_mut() - .query_pairs_mut() - .append_pair("$depth", &depth.to_string()); - } - if let Some(error_policy) = &this.error_policy { - req.url_mut() - .query_pairs_mut() - .append_pair("errorPolicy", &error_policy.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/classificationnodes?ids={}", - self.client.endpoint(), - self.organization, - self.project, - self.ids - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -539,18 +569,56 @@ pub mod classification_nodes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) depth: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Depth of children to fetch."] pub fn depth(mut self, depth: i32) -> Self { self.depth = Some(depth); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(depth) = &this.depth { + req.url_mut() + .query_pairs_mut() + .append_pair("$depth", &depth.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/classificationnodes", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -559,9 +627,7 @@ pub mod classification_nodes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -573,30 +639,24 @@ pub mod classification_nodes { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/classificationnodes", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -650,20 +710,60 @@ pub mod classification_nodes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) structure_group: models::TreeStructureGroup, pub(crate) path: String, pub(crate) depth: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Depth of children to fetch."] pub fn depth(mut self, depth: i32) -> Self { self.depth = Some(depth); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(depth) = &this.depth { + req.url_mut() + .query_pairs_mut() + .append_pair("$depth", &depth.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", + self.client.endpoint(), + self.organization, + self.project, + self.structure_group, + self.path + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -672,9 +772,7 @@ pub mod classification_nodes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -686,32 +784,24 @@ pub mod classification_nodes { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", - self.client.endpoint(), - self.organization, - self.project, - self.structure_group, - self.path - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -765,14 +855,49 @@ pub mod classification_nodes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemClassificationNode, pub(crate) project: String, pub(crate) structure_group: models::TreeStructureGroup, pub(crate) path: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", + self.client.endpoint(), + self.organization, + self.project, + self.structure_group, + self.path + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -782,9 +907,7 @@ pub mod classification_nodes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -796,28 +919,24 @@ pub mod classification_nodes { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", - self.client.endpoint(), - self.organization, - self.project, - self.structure_group, - self.path - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -871,14 +990,49 @@ pub mod classification_nodes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemClassificationNode, pub(crate) project: String, pub(crate) structure_group: models::TreeStructureGroup, pub(crate) path: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", + self.client.endpoint(), + self.organization, + self.project, + self.structure_group, + self.path + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -888,9 +1042,7 @@ pub mod classification_nodes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -902,28 +1054,24 @@ pub mod classification_nodes { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", - self.client.endpoint(), - self.organization, - self.project, - self.structure_group, - self.path - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -969,20 +1117,60 @@ pub mod classification_nodes { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) structure_group: models::TreeStructureGroup, pub(crate) path: String, pub(crate) reclassify_id: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Id of the target classification node for reclassification."] pub fn reclassify_id(mut self, reclassify_id: i32) -> Self { self.reclassify_id = Some(reclassify_id); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + 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::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", + self.client.endpoint(), + self.organization, + self.project, + self.structure_group, + self.path + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -991,9 +1179,7 @@ pub mod classification_nodes { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1005,32 +1191,24 @@ pub mod classification_nodes { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/classificationnodes/{}/{}", - self.client.endpoint(), - self.organization, - self.project, - self.structure_group, - self.path - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1243,8 +1421,12 @@ pub mod queries { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) filter: String, @@ -1252,7 +1434,7 @@ pub mod queries { pub(crate) expand: Option, pub(crate) include_deleted: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The number of queries to return (Default is 50 and maximum is 200)."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -1267,6 +1449,55 @@ pub mod queries { self.include_deleted = Some(include_deleted); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let filter = &this.filter; + req.url_mut() + .query_pairs_mut() + .append_pair("$filter", filter); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + if let Some(include_deleted) = &this.include_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("$includeDeleted", &include_deleted.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queries?$filter={}", + self.client.endpoint(), + self.organization, + self.project, + self.filter + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1275,9 +1506,7 @@ pub mod queries { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1289,45 +1518,24 @@ pub mod queries { auth_header, ); } - let filter = &this.filter; - req.url_mut() - .query_pairs_mut() - .append_pair("$filter", filter); - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - if let Some(include_deleted) = &this.include_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("$includeDeleted", &include_deleted.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queries?$filter={}", - self.client.endpoint(), - self.organization, - self.project, - self.filter - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1381,15 +1589,19 @@ pub mod queries { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) expand: Option, pub(crate) depth: Option, pub(crate) include_deleted: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Include the query string (wiql), clauses, query result columns, and sort options in the results."] pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); @@ -1405,6 +1617,50 @@ pub mod queries { self.include_deleted = Some(include_deleted); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + if let Some(depth) = &this.depth { + req.url_mut() + .query_pairs_mut() + .append_pair("$depth", &depth.to_string()); + } + if let Some(include_deleted) = &this.include_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("$includeDeleted", &include_deleted.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queries", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1413,9 +1669,7 @@ pub mod queries { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1427,40 +1681,24 @@ pub mod queries { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - if let Some(depth) = &this.depth { - req.url_mut() - .query_pairs_mut() - .append_pair("$depth", &depth.to_string()); - } - if let Some(include_deleted) = &this.include_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("$includeDeleted", &include_deleted.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queries", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1511,8 +1749,12 @@ pub mod queries { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) query: String, @@ -1521,7 +1763,7 @@ pub mod queries { pub(crate) include_deleted: Option, pub(crate) use_iso_date_format: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Include the query string (wiql), clauses, query result columns, and sort options in the results."] pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); @@ -1542,6 +1784,56 @@ pub mod queries { self.use_iso_date_format = Some(use_iso_date_format); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + if let Some(depth) = &this.depth { + req.url_mut() + .query_pairs_mut() + .append_pair("$depth", &depth.to_string()); + } + if let Some(include_deleted) = &this.include_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("$includeDeleted", &include_deleted.to_string()); + } + if let Some(use_iso_date_format) = &this.use_iso_date_format { + req.url_mut() + .query_pairs_mut() + .append_pair("$useIsoDateFormat", &use_iso_date_format.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queries/{}", + self.client.endpoint(), + self.organization, + self.project, + self.query + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1550,9 +1842,7 @@ pub mod queries { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1564,46 +1854,24 @@ pub mod queries { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - if let Some(depth) = &this.depth { - req.url_mut() - .query_pairs_mut() - .append_pair("$depth", &depth.to_string()); - } - if let Some(include_deleted) = &this.include_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("$includeDeleted", &include_deleted.to_string()); - } - if let Some(use_iso_date_format) = &this.use_iso_date_format { - req.url_mut() - .query_pairs_mut() - .append_pair("$useIsoDateFormat", &use_iso_date_format.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queries/{}", - self.client.endpoint(), - self.organization, - self.project, - self.query - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1653,20 +1921,60 @@ pub mod queries { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::QueryHierarchyItem, pub(crate) project: String, pub(crate) query: String, pub(crate) validate_wiql_only: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "If you only want to validate your WIQL query without actually creating one, set it to true. Default is false."] pub fn validate_wiql_only(mut self, validate_wiql_only: bool) -> Self { self.validate_wiql_only = Some(validate_wiql_only); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queries/{}", + self.client.endpoint(), + self.organization, + self.project, + self.query + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1675,9 +1983,7 @@ pub mod queries { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1689,32 +1995,24 @@ pub mod queries { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queries/{}", - self.client.endpoint(), - self.organization, - self.project, - self.query - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1764,20 +2062,60 @@ pub mod queries { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::QueryHierarchyItem, pub(crate) project: String, pub(crate) query: String, pub(crate) undelete_descendants: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Undelete the children of this folder. It is important to note that this will not bring back the permission changes that were previously applied to the descendants."] pub fn undelete_descendants(mut self, undelete_descendants: bool) -> Self { self.undelete_descendants = Some(undelete_descendants); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + 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", &undelete_descendants.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queries/{}", + self.client.endpoint(), + self.organization, + self.project, + self.query + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1786,9 +2124,7 @@ pub mod queries { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1800,33 +2136,24 @@ pub mod queries { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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", - &undelete_descendants.to_string(), - ); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queries/{}", - self.client.endpoint(), - self.organization, - self.project, - self.query - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1871,12 +2198,45 @@ pub mod queries { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) query: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queries/{}", + self.client.endpoint(), + self.organization, + self.project, + self.query + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1886,9 +2246,7 @@ pub mod queries { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1900,26 +2258,24 @@ pub mod queries { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queries/{}", - self.client.endpoint(), - self.organization, - self.project, - self.query - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1975,12 +2331,45 @@ pub mod queries { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::QueryBatchGetRequest, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/queriesbatch", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1990,9 +2379,7 @@ pub mod queries { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2004,26 +2391,24 @@ pub mod queries { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/queriesbatch", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2182,12 +2567,47 @@ pub mod recyclebin { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) ids: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let ids = &this.ids; + req.url_mut().query_pairs_mut().append_pair("ids", ids); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/recyclebin?ids={}", + self.client.endpoint(), + self.organization, + self.project, + self.ids + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2197,9 +2617,7 @@ pub mod recyclebin { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2211,28 +2629,24 @@ pub mod recyclebin { auth_header, ); } - let ids = &this.ids; - req.url_mut().query_pairs_mut().append_pair("ids", ids); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/recyclebin?ids={}", - self.client.endpoint(), - self.organization, - self.project, - self.ids - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2288,11 +2702,43 @@ pub mod recyclebin { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/recyclebin", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2302,9 +2748,7 @@ pub mod recyclebin { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2316,25 +2760,24 @@ pub mod recyclebin { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/recyclebin", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2385,12 +2828,45 @@ pub mod recyclebin { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/recyclebin/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2400,9 +2876,7 @@ pub mod recyclebin { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2414,26 +2888,24 @@ pub mod recyclebin { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/recyclebin/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2483,13 +2955,47 @@ pub mod recyclebin { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemDeleteUpdate, pub(crate) id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/recyclebin/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2499,9 +3005,7 @@ pub mod recyclebin { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2513,27 +3017,24 @@ pub mod recyclebin { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/recyclebin/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2578,12 +3079,45 @@ pub mod recyclebin { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/recyclebin/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2593,9 +3127,7 @@ pub mod recyclebin { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2607,26 +3139,24 @@ pub mod recyclebin { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/recyclebin/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2880,14 +3410,53 @@ pub mod comments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CommentCreate, pub(crate) project: String, pub(crate) work_item_id: i32, pub(crate) format: models::CommentFormat, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + let format = &this.format; + req.url_mut() + .query_pairs_mut() + .append_pair("format", &format.to_string()); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments?format={}", + self.client.endpoint(), + self.organization, + self.project, + self.work_item_id, + self.format + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2897,9 +3466,7 @@ pub mod comments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2911,32 +3478,24 @@ pub mod comments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - let format = &this.format; - req.url_mut() - .query_pairs_mut() - .append_pair("format", &format.to_string()); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments?format={}", - self.client.endpoint(), - self.organization, - self.project, - self.work_item_id, - self.format - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2986,8 +3545,12 @@ pub mod comments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) work_item_id: i32, @@ -2997,7 +3560,7 @@ pub mod comments { pub(crate) expand: Option, pub(crate) order: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Max number of comments to return."] pub fn top(mut self, top: i32) -> Self { self.top = Some(top); @@ -3023,6 +3586,61 @@ pub mod comments { self.order = Some(order.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(include_deleted) = &this.include_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDeleted", &include_deleted.to_string()); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + if let Some(order) = &this.order { + req.url_mut() + .query_pairs_mut() + .append_pair("order", &order.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments?", + self.client.endpoint(), + self.organization, + self.project, + self.work_item_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3031,9 +3649,7 @@ pub mod comments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3045,51 +3661,24 @@ pub mod comments { auth_header, ); } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(include_deleted) = &this.include_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("includeDeleted", &include_deleted.to_string()); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - if let Some(order) = &this.order { - req.url_mut() - .query_pairs_mut() - .append_pair("order", &order.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments?", - self.client.endpoint(), - self.organization, - self.project, - self.work_item_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3139,8 +3728,12 @@ pub mod comments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CommentUpdate, pub(crate) project: String, @@ -3148,6 +3741,42 @@ pub mod comments { pub(crate) comment_id: i32, pub(crate) format: models::CommentFormat, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + let format = &this.format; + req.url_mut() + .query_pairs_mut() + .append_pair("format", &format.to_string()); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}?format={}", + self.client.endpoint(), + self.organization, + self.project, + self.work_item_id, + self.comment_id, + self.format + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3157,9 +3786,7 @@ pub mod comments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3171,33 +3798,24 @@ pub mod comments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - let format = &this.format; - req.url_mut() - .query_pairs_mut() - .append_pair("format", &format.to_string()); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}?format={}", - self.client.endpoint(), - self.organization, - self.project, - self.work_item_id, - self.comment_id, - self.format - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3247,8 +3865,12 @@ pub mod comments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) work_item_id: i32, @@ -3256,7 +3878,7 @@ pub mod comments { pub(crate) include_deleted: Option, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Specify if the deleted comments should be retrieved."] pub fn include_deleted(mut self, include_deleted: bool) -> Self { self.include_deleted = Some(include_deleted); @@ -3267,6 +3889,48 @@ pub mod comments { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let ids = &this.ids; + req.url_mut().query_pairs_mut().append_pair("ids", ids); + if let Some(include_deleted) = &this.include_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDeleted", &include_deleted.to_string()); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments", + self.client.endpoint(), + self.organization, + self.project, + self.work_item_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3275,9 +3939,7 @@ pub mod comments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3289,38 +3951,24 @@ pub mod comments { auth_header, ); } - let ids = &this.ids; - req.url_mut().query_pairs_mut().append_pair("ids", ids); - if let Some(include_deleted) = &this.include_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("includeDeleted", &include_deleted.to_string()); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments", - self.client.endpoint(), - self.organization, - self.project, - self.work_item_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3370,13 +4018,47 @@ pub mod comments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CommentCreate, pub(crate) project: String, pub(crate) work_item_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments", + self.client.endpoint(), + self.organization, + self.project, + self.work_item_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3386,9 +4068,7 @@ pub mod comments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3400,27 +4080,24 @@ pub mod comments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments", - self.client.endpoint(), - self.organization, - self.project, - self.work_item_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3470,8 +4147,12 @@ pub mod comments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) work_item_id: i32, @@ -3479,7 +4160,7 @@ pub mod comments { pub(crate) include_deleted: Option, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Specify if the deleted comment should be retrieved."] pub fn include_deleted(mut self, include_deleted: bool) -> Self { self.include_deleted = Some(include_deleted); @@ -3490,6 +4171,47 @@ pub mod comments { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(include_deleted) = &this.include_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDeleted", &include_deleted.to_string()); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.work_item_id, + self.comment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3498,9 +4220,7 @@ pub mod comments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3512,37 +4232,24 @@ pub mod comments { auth_header, ); } - if let Some(include_deleted) = &this.include_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("includeDeleted", &include_deleted.to_string()); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.work_item_id, - self.comment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3592,14 +4299,49 @@ pub mod comments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CommentUpdate, pub(crate) project: String, pub(crate) work_item_id: i32, pub(crate) comment_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.work_item_id, + self.comment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3609,9 +4351,7 @@ pub mod comments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3623,28 +4363,24 @@ pub mod comments { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.work_item_id, - self.comment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3689,13 +4425,47 @@ pub mod comments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) work_item_id: i32, pub(crate) comment_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.work_item_id, + self.comment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3705,9 +4475,7 @@ pub mod comments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3719,27 +4487,24 @@ pub mod comments { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.work_item_id, - self.comment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3812,10 +4577,41 @@ pub mod artifact_link_types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3825,9 +4621,7 @@ pub mod artifact_link_types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3839,24 +4633,24 @@ pub mod artifact_link_types { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3944,10 +4738,41 @@ pub mod work_item_icons { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3957,9 +4782,7 @@ pub mod work_item_icons { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3971,24 +4794,24 @@ pub mod work_item_icons { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4038,14 +4861,18 @@ pub mod work_item_icons { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) icon: String, pub(crate) organization: String, pub(crate) color: Option, pub(crate) v: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The 6-digit hex color for the icon"] pub fn color(mut self, color: impl Into) -> Self { self.color = Some(color.into()); @@ -4056,41 +4883,26 @@ pub mod work_item_icons { self.v = Some(v); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - 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); - } - if let Some(v) = &this.v { - req.url_mut() - .query_pairs_mut() - .append_pair("v", &v.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(color) = &this.color { + req.url_mut().query_pairs_mut().append_pair("color", color); + } + if let Some(v) = &this.v { + req.url_mut() + .query_pairs_mut() + .append_pair("v", &v.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -4107,6 +4919,47 @@ pub mod work_item_icons { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -4193,10 +5046,41 @@ pub mod work_item_relation_types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4206,9 +5090,7 @@ pub mod work_item_relation_types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4220,24 +5102,24 @@ pub mod work_item_relation_types { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4288,11 +5170,43 @@ pub mod work_item_relation_types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) relation: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/_apis/wit/workitemrelationtypes/{}", + self.client.endpoint(), + self.organization, + self.relation + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4302,9 +5216,7 @@ pub mod work_item_relation_types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4316,25 +5228,24 @@ pub mod work_item_relation_types { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/_apis/wit/workitemrelationtypes/{}", - self.client.endpoint(), - self.organization, - self.relation - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4416,18 +5327,57 @@ pub mod work_item_transitions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) ids: String, pub(crate) action: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "possible actions. Currently only supports checkin"] pub fn action(mut self, action: impl Into) -> Self { self.action = Some(action.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let ids = &this.ids; + req.url_mut().query_pairs_mut().append_pair("ids", ids); + if let Some(action) = &this.action { + req.url_mut() + .query_pairs_mut() + .append_pair("action", action); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4436,9 +5386,7 @@ pub mod work_item_transitions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4450,31 +5398,24 @@ pub mod work_item_transitions { auth_header, ); } - let ids = &this.ids; - req.url_mut().query_pairs_mut().append_pair("ids", ids); - if let Some(action) = &this.action { - req.url_mut() - .query_pairs_mut() - .append_pair("action", action); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4550,10 +5491,41 @@ pub mod account_my_work_recent_activity { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&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 == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4563,9 +5535,7 @@ pub mod account_my_work_recent_activity { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4577,24 +5547,24 @@ pub mod account_my_work_recent_activity { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&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 == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4679,12 +5649,45 @@ pub mod artifact_uri_query { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ArtifactUriQuery, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/artifacturiquery", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4694,9 +5697,7 @@ pub mod artifact_uri_query { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4708,26 +5709,24 @@ pub mod artifact_uri_query { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/artifacturiquery", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4857,8 +5856,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: String, pub(crate) project: String, @@ -4866,7 +5869,7 @@ pub mod attachments { pub(crate) upload_type: Option, pub(crate) area_path: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The name of the file"] pub fn file_name(mut self, file_name: impl Into) -> Self { self.file_name = Some(file_name.into()); @@ -4882,6 +5885,51 @@ pub mod attachments { self.area_path = Some(area_path.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/octet-stream"); + let req_body = azure_core::json::to_json(&this.body)?; + if let Some(file_name) = &this.file_name { + req.url_mut() + .query_pairs_mut() + .append_pair("fileName", file_name); + } + if let Some(upload_type) = &this.upload_type { + req.url_mut() + .query_pairs_mut() + .append_pair("uploadType", upload_type); + } + if let Some(area_path) = &this.area_path { + req.url_mut() + .query_pairs_mut() + .append_pair("areaPath", area_path); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/attachments", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -4890,9 +5938,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4904,41 +5950,24 @@ pub mod attachments { auth_header, ); } - req.insert_header("content-type", "application/octet-stream"); - let req_body = azure_core::json::to_json(&this.body)?; - if let Some(file_name) = &this.file_name { - req.url_mut() - .query_pairs_mut() - .append_pair("fileName", file_name); - } - if let Some(upload_type) = &this.upload_type { - req.url_mut() - .query_pairs_mut() - .append_pair("uploadType", upload_type); - } - if let Some(area_path) = &this.area_path { - req.url_mut() - .query_pairs_mut() - .append_pair("areaPath", area_path); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/attachments", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4986,15 +6015,19 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: String, pub(crate) project: String, pub(crate) file_name: Option, pub(crate) download: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Name of the file"] pub fn file_name(mut self, file_name: impl Into) -> Self { self.file_name = Some(file_name.into()); @@ -5005,43 +6038,28 @@ pub mod attachments { self.download = Some(download); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - if let Some(file_name) = &this.file_name { - req.url_mut() - .query_pairs_mut() - .append_pair("fileName", file_name); - } - if let Some(download) = &this.download { - req.url_mut() - .query_pairs_mut() - .append_pair("download", &download.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(file_name) = &this.file_name { + req.url_mut() + .query_pairs_mut() + .append_pair("fileName", file_name); + } + if let Some(download) = &this.download { + req.url_mut() + .query_pairs_mut() + .append_pair("download", &download.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -5059,6 +6077,47 @@ pub mod attachments { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -5106,8 +6165,12 @@ pub mod attachments { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: String, pub(crate) id: String, @@ -5115,11 +6178,48 @@ pub mod attachments { pub(crate) project: String, pub(crate) file_name: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn file_name(mut self, file_name: impl Into) -> Self { self.file_name = Some(file_name.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/octet-stream"); + 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() + .query_pairs_mut() + .append_pair("fileName", file_name); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/attachments/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5128,9 +6228,7 @@ pub mod attachments { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5142,33 +6240,24 @@ pub mod attachments { auth_header, ); } - req.insert_header("content-type", "application/octet-stream"); - 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() - .query_pairs_mut() - .append_pair("fileName", file_name); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/attachments/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5324,18 +6413,56 @@ pub mod fields { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Use ExtensionFields to include extension fields, otherwise exclude them. Unless the feature flag for this parameter is enabled, extension fields are always included."] pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/fields", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -5344,9 +6471,7 @@ pub mod fields { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5358,30 +6483,24 @@ pub mod fields { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/fields", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5431,12 +6550,45 @@ pub mod fields { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemField2, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/fields", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5446,9 +6598,7 @@ pub mod fields { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5460,26 +6610,24 @@ pub mod fields { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/fields", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5529,12 +6677,45 @@ pub mod fields { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) field_name_or_ref_name: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/fields/{}", + self.client.endpoint(), + self.organization, + self.project, + self.field_name_or_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5544,9 +6725,7 @@ pub mod fields { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5558,26 +6737,24 @@ pub mod fields { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/fields/{}", - self.client.endpoint(), - self.organization, - self.project, - self.field_name_or_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5627,13 +6804,47 @@ pub mod fields { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::FieldUpdate, pub(crate) field_name_or_ref_name: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/fields/{}", + self.client.endpoint(), + self.organization, + self.project, + self.field_name_or_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5643,9 +6854,7 @@ pub mod fields { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5657,27 +6866,24 @@ pub mod fields { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/fields/{}", - self.client.endpoint(), - self.organization, - self.project, - self.field_name_or_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5722,12 +6928,45 @@ pub mod fields { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) field_name_or_ref_name: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/fields/{}", + self.client.endpoint(), + self.organization, + self.project, + self.field_name_or_ref_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5737,9 +6976,7 @@ pub mod fields { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5751,26 +6988,24 @@ pub mod fields { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/fields/{}", - self.client.endpoint(), - self.organization, - self.project, - self.field_name_or_ref_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5854,12 +7089,45 @@ pub mod project_process_migration { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ProcessIdModel, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/projectprocessmigration", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5869,9 +7137,7 @@ pub mod project_process_migration { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5883,26 +7149,24 @@ pub mod project_process_migration { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/projectprocessmigration", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5986,8 +7250,12 @@ pub mod reporting_work_item_links { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) link_types: Option, @@ -5995,7 +7263,7 @@ pub mod reporting_work_item_links { pub(crate) continuation_token: Option, pub(crate) start_date_time: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A list of types to filter the results to specific link types. Omit this parameter to get work item links of all link types."] pub fn link_types(mut self, link_types: impl Into) -> Self { self.link_types = Some(link_types.into()); @@ -6019,6 +7287,54 @@ pub mod reporting_work_item_links { self.start_date_time = Some(start_date_time.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(link_types) = &this.link_types { + req.url_mut() + .query_pairs_mut() + .append_pair("linkTypes", link_types); + } + if let Some(types) = &this.types { + req.url_mut().query_pairs_mut().append_pair("types", types); + } + 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", &formatted_date_time); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/reporting/workitemlinks", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6027,9 +7343,7 @@ pub mod reporting_work_item_links { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6041,45 +7355,24 @@ pub mod reporting_work_item_links { auth_header, ); } - if let Some(link_types) = &this.link_types { - req.url_mut() - .query_pairs_mut() - .append_pair("linkTypes", link_types); - } - if let Some(types) = &this.types { - req.url_mut().query_pairs_mut().append_pair("types", types); - } - 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", &formatted_date_time); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/reporting/workitemlinks", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6192,8 +7485,12 @@ pub mod reporting_work_item_revisions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) fields: Option, @@ -6208,7 +7505,7 @@ pub mod reporting_work_item_revisions { pub(crate) include_discussion_changes_only: Option, pub(crate) max_page_size: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A list of fields to return in work item revisions. Omit this parameter to get all reportable fields."] pub fn fields(mut self, fields: impl Into) -> Self { self.fields = Some(fields.into()); @@ -6270,6 +7567,91 @@ pub mod reporting_work_item_revisions { self.max_page_size = Some(max_page_size); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(fields) = &this.fields { + req.url_mut() + .query_pairs_mut() + .append_pair("fields", fields); + } + if let Some(types) = &this.types { + req.url_mut().query_pairs_mut().append_pair("types", types); + } + 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", &formatted_date_time); + } + if let Some(include_identity_ref) = &this.include_identity_ref { + req.url_mut() + .query_pairs_mut() + .append_pair("includeIdentityRef", &include_identity_ref.to_string()); + } + if let Some(include_deleted) = &this.include_deleted { + req.url_mut() + .query_pairs_mut() + .append_pair("includeDeleted", &include_deleted.to_string()); + } + if let Some(include_tag_ref) = &this.include_tag_ref { + req.url_mut() + .query_pairs_mut() + .append_pair("includeTagRef", &include_tag_ref.to_string()); + } + if let Some(include_latest_only) = &this.include_latest_only { + req.url_mut() + .query_pairs_mut() + .append_pair("includeLatestOnly", &include_latest_only.to_string()); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + if let Some(include_discussion_changes_only) = &this.include_discussion_changes_only + { + req.url_mut().query_pairs_mut().append_pair( + "includeDiscussionChangesOnly", + &include_discussion_changes_only.to_string(), + ); + } + if let Some(max_page_size) = &this.max_page_size { + req.url_mut() + .query_pairs_mut() + .append_pair("$maxPageSize", &max_page_size.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/reporting/workitemrevisions", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6278,9 +7660,7 @@ pub mod reporting_work_item_revisions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6292,84 +7672,24 @@ pub mod reporting_work_item_revisions { auth_header, ); } - if let Some(fields) = &this.fields { - req.url_mut() - .query_pairs_mut() - .append_pair("fields", fields); - } - if let Some(types) = &this.types { - req.url_mut().query_pairs_mut().append_pair("types", types); - } - 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", &formatted_date_time); - } - if let Some(include_identity_ref) = &this.include_identity_ref { - req.url_mut().query_pairs_mut().append_pair( - "includeIdentityRef", - &include_identity_ref.to_string(), - ); - } - if let Some(include_deleted) = &this.include_deleted { - req.url_mut() - .query_pairs_mut() - .append_pair("includeDeleted", &include_deleted.to_string()); - } - if let Some(include_tag_ref) = &this.include_tag_ref { - req.url_mut() - .query_pairs_mut() - .append_pair("includeTagRef", &include_tag_ref.to_string()); - } - if let Some(include_latest_only) = &this.include_latest_only { - req.url_mut() - .query_pairs_mut() - .append_pair("includeLatestOnly", &include_latest_only.to_string()); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - if let Some(include_discussion_changes_only) = - &this.include_discussion_changes_only - { - req.url_mut().query_pairs_mut().append_pair( - "includeDiscussionChangesOnly", - &include_discussion_changes_only.to_string(), - ); - } - if let Some(max_page_size) = &this.max_page_size { - req.url_mut() - .query_pairs_mut() - .append_pair("$maxPageSize", &max_page_size.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/reporting/workitemrevisions", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6423,8 +7743,12 @@ pub mod reporting_work_item_revisions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ReportingWorkItemRevisionsFilter, pub(crate) project: String, @@ -6432,7 +7756,7 @@ pub mod reporting_work_item_revisions { pub(crate) start_date_time: Option, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions."] pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { self.continuation_token = Some(continuation_token.into()); @@ -6450,6 +7774,52 @@ pub mod reporting_work_item_revisions { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + 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", &formatted_date_time); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/reporting/workitemrevisions", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6458,9 +7828,7 @@ pub mod reporting_work_item_revisions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6472,43 +7840,24 @@ pub mod reporting_work_item_revisions { auth_header, ); } - req.insert_header("content-type", "application/json"); - 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", &formatted_date_time); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/reporting/workitemrevisions", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6588,14 +7937,18 @@ pub mod work_item_revisions_discussions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) continuation_token: Option, pub(crate) max_page_size: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn continuation_token(mut self, continuation_token: impl Into) -> Self { self.continuation_token = Some(continuation_token.into()); self @@ -6604,6 +7957,45 @@ pub mod work_item_revisions_discussions { self.max_page_size = Some(max_page_size); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(continuation_token) = &this.continuation_token { + req.url_mut() + .query_pairs_mut() + .append_pair("continuationToken", continuation_token); + } + if let Some(max_page_size) = &this.max_page_size { + req.url_mut() + .query_pairs_mut() + .append_pair("$maxPageSize", &max_page_size.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/reporting/workItemRevisions/discussions", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6612,9 +8004,7 @@ pub mod work_item_revisions_discussions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6626,35 +8016,24 @@ pub mod work_item_revisions_discussions { auth_header, ); } - if let Some(continuation_token) = &this.continuation_token { - req.url_mut() - .query_pairs_mut() - .append_pair("continuationToken", continuation_token); - } - if let Some(max_page_size) = &this.max_page_size { - req.url_mut() - .query_pairs_mut() - .append_pair("$maxPageSize", &max_page_size.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/reporting/workItemRevisions/discussions", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6728,12 +8107,45 @@ pub mod send_mail { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::SendMailBody, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/sendmail", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6743,9 +8155,7 @@ pub mod send_mail { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6757,26 +8167,24 @@ pub mod send_mail { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/sendmail", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6917,11 +8325,43 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/tags", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6931,9 +8371,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6945,25 +8383,24 @@ pub mod tags { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/tags", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7014,24 +8451,55 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) tag_id_or_name: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/tags/{}", + self.client.endpoint(), + self.organization, + self.project, + self.tag_id_or_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] pub fn send(self) -> BoxFuture<'static, azure_core::Result> { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7043,26 +8511,24 @@ pub mod tags { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/tags/{}", - self.client.endpoint(), - self.organization, - self.project, - self.tag_id_or_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7112,13 +8578,47 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemTagDefinition, pub(crate) project: String, pub(crate) tag_id_or_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/tags/{}", + self.client.endpoint(), + self.organization, + self.project, + self.tag_id_or_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7128,9 +8628,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7142,27 +8640,24 @@ pub mod tags { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/tags/{}", - self.client.endpoint(), - self.organization, - self.project, - self.tag_id_or_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7207,12 +8702,45 @@ pub mod tags { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) tag_id_or_name: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/tags/{}", + self.client.endpoint(), + self.organization, + self.project, + self.tag_id_or_name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7222,9 +8750,7 @@ pub mod tags { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7236,26 +8762,24 @@ pub mod tags { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/tags/{}", - self.client.endpoint(), - self.organization, - self.project, - self.tag_id_or_name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7340,12 +8864,45 @@ pub mod temp_queries { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TemporaryQueryRequestModel, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/tempqueries", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7355,9 +8912,7 @@ pub mod temp_queries { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7369,26 +8924,24 @@ pub mod temp_queries { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/tempqueries", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7624,8 +9177,12 @@ pub mod work_items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) ids: String, pub(crate) project: String, @@ -7634,7 +9191,7 @@ pub mod work_items { pub(crate) expand: Option, pub(crate) error_policy: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Comma-separated list of requested fields"] pub fn fields(mut self, fields: impl Into) -> Self { self.fields = Some(fields.into()); @@ -7658,6 +9215,58 @@ pub mod work_items { self.error_policy = Some(error_policy.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let ids = &this.ids; + req.url_mut().query_pairs_mut().append_pair("ids", ids); + if let Some(fields) = &this.fields { + req.url_mut() + .query_pairs_mut() + .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", &formatted_date_time); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + if let Some(error_policy) = &this.error_policy { + req.url_mut() + .query_pairs_mut() + .append_pair("errorPolicy", &error_policy.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitems", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7666,9 +9275,7 @@ pub mod work_items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7680,48 +9287,24 @@ pub mod work_items { auth_header, ); } - let ids = &this.ids; - req.url_mut().query_pairs_mut().append_pair("ids", ids); - if let Some(fields) = &this.fields { - req.url_mut() - .query_pairs_mut() - .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", &formatted_date_time); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - if let Some(error_policy) = &this.error_policy { - req.url_mut() - .query_pairs_mut() - .append_pair("errorPolicy", &error_policy.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitems", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7771,8 +9354,12 @@ pub mod work_items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) type_: String, @@ -7780,7 +9367,7 @@ pub mod work_items { pub(crate) as_of: Option, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Comma-separated list of requested fields"] pub fn fields(mut self, fields: impl Into) -> Self { self.fields = Some(fields.into()); @@ -7796,6 +9383,52 @@ pub mod work_items { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(fields) = &this.fields { + req.url_mut() + .query_pairs_mut() + .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", &formatted_date_time); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitems/${}", + self.client.endpoint(), + self.organization, + self.project, + self.type_ + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7804,9 +9437,7 @@ pub mod work_items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7818,42 +9449,24 @@ pub mod work_items { auth_header, ); } - if let Some(fields) = &this.fields { - req.url_mut() - .query_pairs_mut() - .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", &formatted_date_time); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitems/${}", - self.client.endpoint(), - self.organization, - self.project, - self.type_ - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7903,8 +9516,12 @@ pub mod work_items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, @@ -7914,7 +9531,7 @@ pub mod work_items { pub(crate) suppress_notifications: Option, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Indicate if you only want to validate the changes without saving the work item"] pub fn validate_only(mut self, validate_only: bool) -> Self { self.validate_only = Some(validate_only); @@ -7935,6 +9552,57 @@ pub mod work_items { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::json::to_json(&this.body)?; + if let Some(validate_only) = &this.validate_only { + req.url_mut() + .query_pairs_mut() + .append_pair("validateOnly", &validate_only.to_string()); + } + if let Some(bypass_rules) = &this.bypass_rules { + req.url_mut() + .query_pairs_mut() + .append_pair("bypassRules", &bypass_rules.to_string()); + } + if let Some(suppress_notifications) = &this.suppress_notifications { + req.url_mut() + .query_pairs_mut() + .append_pair("suppressNotifications", &suppress_notifications.to_string()); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitems/${}", + self.client.endpoint(), + self.organization, + self.project, + self.type_ + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -7943,9 +9611,7 @@ pub mod work_items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7957,48 +9623,24 @@ pub mod work_items { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::json::to_json(&this.body)?; - if let Some(validate_only) = &this.validate_only { - req.url_mut() - .query_pairs_mut() - .append_pair("validateOnly", &validate_only.to_string()); - } - if let Some(bypass_rules) = &this.bypass_rules { - req.url_mut() - .query_pairs_mut() - .append_pair("bypassRules", &bypass_rules.to_string()); - } - if let Some(suppress_notifications) = &this.suppress_notifications { - req.url_mut().query_pairs_mut().append_pair( - "suppressNotifications", - &suppress_notifications.to_string(), - ); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitems/${}", - self.client.endpoint(), - self.organization, - self.project, - self.type_ - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8048,8 +9690,12 @@ pub mod work_items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: i32, pub(crate) project: String, @@ -8057,7 +9703,7 @@ pub mod work_items { pub(crate) as_of: Option, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Comma-separated list of requested fields"] pub fn fields(mut self, fields: impl Into) -> Self { self.fields = Some(fields.into()); @@ -8073,6 +9719,52 @@ pub mod work_items { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(fields) = &this.fields { + req.url_mut() + .query_pairs_mut() + .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", &formatted_date_time); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitems/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8081,9 +9773,7 @@ pub mod work_items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8095,42 +9785,24 @@ pub mod work_items { auth_header, ); } - if let Some(fields) = &this.fields { - req.url_mut() - .query_pairs_mut() - .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", &formatted_date_time); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitems/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8180,8 +9852,12 @@ pub mod work_items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) id: i32, @@ -8191,7 +9867,7 @@ pub mod work_items { pub(crate) suppress_notifications: Option, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Indicate if you only want to validate the changes without saving the work item"] pub fn validate_only(mut self, validate_only: bool) -> Self { self.validate_only = Some(validate_only); @@ -8212,6 +9888,57 @@ pub mod work_items { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json-patch+json"); + let req_body = azure_core::json::to_json(&this.body)?; + if let Some(validate_only) = &this.validate_only { + req.url_mut() + .query_pairs_mut() + .append_pair("validateOnly", &validate_only.to_string()); + } + if let Some(bypass_rules) = &this.bypass_rules { + req.url_mut() + .query_pairs_mut() + .append_pair("bypassRules", &bypass_rules.to_string()); + } + if let Some(suppress_notifications) = &this.suppress_notifications { + req.url_mut() + .query_pairs_mut() + .append_pair("suppressNotifications", &suppress_notifications.to_string()); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitems/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8220,9 +9947,7 @@ pub mod work_items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8234,48 +9959,24 @@ pub mod work_items { auth_header, ); } - req.insert_header("content-type", "application/json-patch+json"); - let req_body = azure_core::json::to_json(&this.body)?; - if let Some(validate_only) = &this.validate_only { - req.url_mut() - .query_pairs_mut() - .append_pair("validateOnly", &validate_only.to_string()); - } - if let Some(bypass_rules) = &this.bypass_rules { - req.url_mut() - .query_pairs_mut() - .append_pair("bypassRules", &bypass_rules.to_string()); - } - if let Some(suppress_notifications) = &this.suppress_notifications { - req.url_mut().query_pairs_mut().append_pair( - "suppressNotifications", - &suppress_notifications.to_string(), - ); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitems/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8325,19 +10026,58 @@ pub mod work_items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: i32, pub(crate) project: String, pub(crate) destroy: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone."] pub fn destroy(mut self, destroy: bool) -> Self { self.destroy = Some(destroy); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + if let Some(destroy) = &this.destroy { + req.url_mut() + .query_pairs_mut() + .append_pair("destroy", &destroy.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitems/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8346,9 +10086,7 @@ pub mod work_items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8360,31 +10098,24 @@ pub mod work_items { 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::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitems/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8434,12 +10165,45 @@ pub mod work_items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemBatchGetRequest, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemsbatch", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8449,9 +10213,7 @@ pub mod work_items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8463,26 +10225,24 @@ pub mod work_items { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemsbatch", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8532,12 +10292,45 @@ pub mod work_items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemDeleteBatchRequest, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemsdelete", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -8547,9 +10340,7 @@ pub mod work_items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8561,26 +10352,24 @@ pub mod work_items { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemsdelete", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8682,8 +10471,12 @@ pub mod revisions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: i32, pub(crate) project: String, @@ -8691,7 +10484,7 @@ pub mod revisions { pub(crate) skip: Option, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn top(mut self, top: i32) -> Self { self.top = Some(top); self @@ -8704,6 +10497,51 @@ pub mod revisions { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/revisions", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8712,9 +10550,7 @@ pub mod revisions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8726,41 +10562,24 @@ pub mod revisions { auth_header, ); } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/revisions", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8810,19 +10629,59 @@ pub mod revisions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: i32, pub(crate) revision_number: i32, pub(crate) project: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn expand(mut self, expand: impl Into) -> Self { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/revisions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id, + self.revision_number + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8831,9 +10690,7 @@ pub mod revisions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -8845,32 +10702,24 @@ pub mod revisions { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/revisions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id, - self.revision_number - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -8970,15 +10819,19 @@ pub mod updates { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: i32, pub(crate) project: String, pub(crate) top: Option, pub(crate) skip: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn top(mut self, top: i32) -> Self { self.top = Some(top); self @@ -8987,6 +10840,46 @@ pub mod updates { self.skip = Some(skip); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/updates", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -8995,9 +10888,7 @@ pub mod updates { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9009,36 +10900,24 @@ pub mod updates { auth_header, ); } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/updates", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9088,13 +10967,47 @@ pub mod updates { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: i32, pub(crate) update_number: i32, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/updates/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id, + self.update_number + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9104,9 +11017,7 @@ pub mod updates { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9118,27 +11029,24 @@ pub mod updates { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/updates/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id, - self.update_number - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9270,13 +11178,47 @@ pub mod comments_reactions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) work_item_id: i32, pub(crate) comment_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions", + self.client.endpoint(), + self.organization, + self.project, + self.work_item_id, + self.comment_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9286,9 +11228,7 @@ pub mod comments_reactions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9300,27 +11240,24 @@ pub mod comments_reactions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions", - self.client.endpoint(), - self.organization, - self.project, - self.work_item_id, - self.comment_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9370,14 +11307,49 @@ pub mod comments_reactions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) work_item_id: i32, pub(crate) comment_id: i32, pub(crate) reaction_type: models::CommentReactionType, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.work_item_id, + self.comment_id, + self.reaction_type + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9387,9 +11359,7 @@ pub mod comments_reactions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9401,28 +11371,24 @@ pub mod comments_reactions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.work_item_id, - self.comment_id, - self.reaction_type - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9472,14 +11438,49 @@ pub mod comments_reactions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) work_item_id: i32, pub(crate) comment_id: i32, pub(crate) reaction_type: models::CommentReactionType, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.work_item_id, + self.comment_id, + self.reaction_type + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9489,9 +11490,7 @@ pub mod comments_reactions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9503,28 +11502,24 @@ pub mod comments_reactions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.work_item_id, - self.comment_id, - self.reaction_type - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9611,8 +11606,12 @@ pub mod comment_reactions_engaged_users { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) work_item_id: i32, @@ -9621,7 +11620,7 @@ pub mod comment_reactions_engaged_users { pub(crate) top: Option, pub(crate) skip: Option, } - impl RequestBuilder { + impl RequestBuilder { pub fn top(mut self, top: i32) -> Self { self.top = Some(top); self @@ -9630,6 +11629,48 @@ pub mod comment_reactions_engaged_users { self.skip = Some(skip); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + if let Some(skip) = &this.skip { + req.url_mut() + .query_pairs_mut() + .append_pair("$skip", &skip.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}/users", + self.client.endpoint(), + self.organization, + self.project, + self.work_item_id, + self.comment_id, + self.reaction_type + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -9638,9 +11679,7 @@ pub mod comment_reactions_engaged_users { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9652,38 +11691,24 @@ pub mod comment_reactions_engaged_users { auth_header, ); } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - if let Some(skip) = &this.skip { - req.url_mut() - .query_pairs_mut() - .append_pair("$skip", &skip.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}/users", - self.client.endpoint(), - self.organization, - self.project, - self.work_item_id, - self.comment_id, - self.reaction_type - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -9781,41 +11806,29 @@ pub mod comments_versions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) work_item_id: i32, pub(crate) comment_id: i32, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -9834,6 +11847,47 @@ pub mod comments_versions { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -9881,14 +11935,49 @@ pub mod comments_versions { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) work_item_id: i32, pub(crate) comment_id: i32, pub(crate) version: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/versions/{}", + self.client.endpoint(), + self.organization, + self.project, + self.work_item_id, + self.comment_id, + self.version + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -9898,9 +11987,7 @@ pub mod comments_versions { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -9912,28 +11999,24 @@ pub mod comments_versions { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/versions/{}", - self.client.endpoint(), - self.organization, - self.project, - self.work_item_id, - self.comment_id, - self.version - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10031,11 +12114,43 @@ pub mod work_item_type_categories { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemtypecategories", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10045,9 +12160,7 @@ pub mod work_item_type_categories { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10059,25 +12172,24 @@ pub mod work_item_type_categories { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemtypecategories", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10128,12 +12240,45 @@ pub mod work_item_type_categories { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) category: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemtypecategories/{}", + self.client.endpoint(), + self.organization, + self.project, + self.category + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10143,9 +12288,7 @@ pub mod work_item_type_categories { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10157,26 +12300,24 @@ pub mod work_item_type_categories { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemtypecategories/{}", - self.client.endpoint(), - self.organization, - self.project, - self.category - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10271,11 +12412,43 @@ pub mod work_item_types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemtypes", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10285,9 +12458,7 @@ pub mod work_item_types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10299,25 +12470,24 @@ pub mod work_item_types { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemtypes", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10367,12 +12537,45 @@ pub mod work_item_types { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) type_: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemtypes/{}", + self.client.endpoint(), + self.organization, + self.project, + self.type_ + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10382,9 +12585,7 @@ pub mod work_item_types { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10396,26 +12597,24 @@ pub mod work_item_types { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemtypes/{}", - self.client.endpoint(), - self.organization, - self.project, - self.type_ - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10522,14 +12721,18 @@ pub mod work_item_types_field { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) type_: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Expand level for the API response. Properties: to include allowedvalues, default value, isRequired etc. as a part of response; None: to skip these properties."] pub fn expand( mut self, @@ -10538,6 +12741,41 @@ pub mod work_item_types_field { self.expand = Some(expand.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemtypes/{}/fields", + self.client.endpoint(), + self.organization, + self.project, + self.type_ + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -10546,9 +12784,7 @@ pub mod work_item_types_field { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10560,31 +12796,24 @@ pub mod work_item_types_field { auth_header, ); } - if let Some(expand) = &this.expand { - req.url_mut() - .query_pairs_mut() - .append_pair("$expand", &expand.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemtypes/{}/fields", - self.client.endpoint(), - self.organization, - self.project, - self.type_ - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -10638,15 +12867,19 @@ pub mod work_item_types_field { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) type_: String, pub(crate) field: String, pub(crate) expand: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Expand level for the API response. Properties: to include allowedvalues, default value, isRequired etc. as a part of response; None: to skip these properties."] pub fn expand( mut self, @@ -10655,38 +12888,23 @@ pub mod work_item_types_field { self.expand = Some(expand.into()); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - 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.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(expand) = &this.expand { + req.url_mut() + .query_pairs_mut() + .append_pair("$expand", &expand.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -10705,6 +12923,47 @@ pub mod work_item_types_field { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = @@ -10785,12 +13044,45 @@ pub mod work_item_type_states { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) type_: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/wit/workitemtypes/{}/states", + self.client.endpoint(), + self.organization, + self.project, + self.type_ + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -10800,9 +13092,7 @@ pub mod work_item_type_states { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -10814,26 +13104,24 @@ pub mod work_item_type_states { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/wit/workitemtypes/{}/states", - self.client.endpoint(), - self.organization, - self.project, - self.type_ - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11008,19 +13296,58 @@ pub mod templates { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, pub(crate) workitemtypename: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Optional, When specified returns templates for given Work item type."] pub fn workitemtypename(mut self, workitemtypename: impl Into) -> Self { self.workitemtypename = Some(workitemtypename.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(workitemtypename) = &this.workitemtypename { + req.url_mut() + .query_pairs_mut() + .append_pair("workitemtypename", workitemtypename); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/templates", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -11029,9 +13356,7 @@ pub mod templates { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11043,31 +13368,24 @@ pub mod templates { auth_header, ); } - if let Some(workitemtypename) = &this.workitemtypename { - req.url_mut() - .query_pairs_mut() - .append_pair("workitemtypename", workitemtypename); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/templates", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11118,13 +13436,47 @@ pub mod templates { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemTemplate, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/templates", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11134,9 +13486,7 @@ pub mod templates { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11148,27 +13498,24 @@ pub mod templates { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/templates", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11218,13 +13565,47 @@ pub mod templates { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, pub(crate) template_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/templates/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.template_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11234,9 +13615,7 @@ pub mod templates { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11248,27 +13627,24 @@ pub mod templates { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/templates/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.template_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11318,14 +13694,49 @@ pub mod templates { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::WorkItemTemplate, pub(crate) project: String, pub(crate) team: String, pub(crate) template_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/templates/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.template_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11335,9 +13746,7 @@ pub mod templates { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11349,28 +13758,24 @@ pub mod templates { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/templates/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.template_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11415,13 +13820,47 @@ pub mod templates { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, pub(crate) template_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/templates/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.template_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -11431,9 +13870,7 @@ pub mod templates { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11445,27 +13882,24 @@ pub mod templates { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/templates/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.template_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11600,8 +14034,12 @@ pub mod wiql { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::Wiql, pub(crate) project: String, @@ -11609,7 +14047,7 @@ pub mod wiql { pub(crate) time_precision: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Whether or not to use time precision."] pub fn time_precision(mut self, time_precision: bool) -> Self { self.time_precision = Some(time_precision); @@ -11620,17 +14058,56 @@ pub mod wiql { self.top = Some(top); self } - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + if let Some(time_precision) = &this.time_precision { + req.url_mut() + .query_pairs_mut() + .append_pair("timePrecision", &time_precision.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/wiql", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11642,37 +14119,24 @@ pub mod wiql { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - if let Some(time_precision) = &this.time_precision { - req.url_mut() - .query_pairs_mut() - .append_pair("timePrecision", &time_precision.to_string()); - } - 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?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/wiql", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11722,8 +14186,12 @@ pub mod wiql { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: String, pub(crate) project: String, @@ -11731,7 +14199,7 @@ pub mod wiql { pub(crate) time_precision: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Whether or not to use time precision."] pub fn time_precision(mut self, time_precision: bool) -> Self { self.time_precision = Some(time_precision); @@ -11742,6 +14210,47 @@ pub mod wiql { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(time_precision) = &this.time_precision { + req.url_mut() + .query_pairs_mut() + .append_pair("timePrecision", &time_precision.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/wiql/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -11750,9 +14259,7 @@ pub mod wiql { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11764,37 +14271,24 @@ pub mod wiql { auth_header, ); } - if let Some(time_precision) = &this.time_precision { - req.url_mut() - .query_pairs_mut() - .append_pair("timePrecision", &time_precision.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/wiql/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11842,8 +14336,12 @@ pub mod wiql { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) id: String, pub(crate) project: String, @@ -11851,7 +14349,7 @@ pub mod wiql { pub(crate) time_precision: Option, pub(crate) top: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Whether or not to use time precision."] pub fn time_precision(mut self, time_precision: bool) -> Self { self.time_precision = Some(time_precision); @@ -11862,6 +14360,47 @@ pub mod wiql { self.top = Some(top); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Head); + if let Some(time_precision) = &this.time_precision { + req.url_mut() + .query_pairs_mut() + .append_pair("timePrecision", &time_precision.to_string()); + } + if let Some(top) = &this.top { + req.url_mut() + .query_pairs_mut() + .append_pair("$top", &top.to_string()); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/wit/wiql/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -11870,9 +14409,7 @@ pub mod wiql { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Head); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -11884,37 +14421,24 @@ pub mod wiql { auth_header, ); } - if let Some(time_precision) = &this.time_precision { - req.url_mut() - .query_pairs_mut() - .append_pair("timePrecision", &time_precision.to_string()); - } - if let Some(top) = &this.top { - req.url_mut() - .query_pairs_mut() - .append_pair("$top", &top.to_string()); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/wit/wiql/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -11931,3 +14455,1915 @@ pub mod wiql { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn account_my_work_recent_activity_client( + &self, + ) -> account_my_work_recent_activity::Client { + account_my_work_recent_activity::Client(self.clone()) + } + pub fn artifact_link_types_client(&self) -> artifact_link_types::Client { + artifact_link_types::Client(self.clone()) + } + pub fn artifact_uri_query_client(&self) -> artifact_uri_query::Client { + artifact_uri_query::Client(self.clone()) + } + pub fn attachments_client(&self) -> attachments::Client { + attachments::Client(self.clone()) + } + pub fn classification_nodes_client(&self) -> classification_nodes::Client { + classification_nodes::Client(self.clone()) + } + pub fn comment_reactions_engaged_users_client( + &self, + ) -> comment_reactions_engaged_users::Client { + comment_reactions_engaged_users::Client(self.clone()) + } + pub fn comments_client(&self) -> comments::Client { + comments::Client(self.clone()) + } + pub fn comments_reactions_client(&self) -> comments_reactions::Client { + comments_reactions::Client(self.clone()) + } + pub fn comments_versions_client(&self) -> comments_versions::Client { + comments_versions::Client(self.clone()) + } + pub fn fields_client(&self) -> fields::Client { + fields::Client(self.clone()) + } + pub fn project_process_migration_client(&self) -> project_process_migration::Client { + project_process_migration::Client(self.clone()) + } + pub fn queries_client(&self) -> queries::Client { + queries::Client(self.clone()) + } + pub fn recyclebin_client(&self) -> recyclebin::Client { + recyclebin::Client(self.clone()) + } + pub fn reporting_work_item_links_client(&self) -> reporting_work_item_links::Client { + reporting_work_item_links::Client(self.clone()) + } + pub fn reporting_work_item_revisions_client( + &self, + ) -> reporting_work_item_revisions::Client { + reporting_work_item_revisions::Client(self.clone()) + } + pub fn revisions_client(&self) -> revisions::Client { + revisions::Client(self.clone()) + } + pub fn send_mail_client(&self) -> send_mail::Client { + send_mail::Client(self.clone()) + } + pub fn tags_client(&self) -> tags::Client { + tags::Client(self.clone()) + } + pub fn temp_queries_client(&self) -> temp_queries::Client { + temp_queries::Client(self.clone()) + } + pub fn templates_client(&self) -> templates::Client { + templates::Client(self.clone()) + } + pub fn updates_client(&self) -> updates::Client { + updates::Client(self.clone()) + } + pub fn wiql_client(&self) -> wiql::Client { + wiql::Client(self.clone()) + } + pub fn work_item_icons_client(&self) -> work_item_icons::Client { + work_item_icons::Client(self.clone()) + } + pub fn work_item_relation_types_client(&self) -> work_item_relation_types::Client { + work_item_relation_types::Client(self.clone()) + } + pub fn work_item_revisions_discussions_client( + &self, + ) -> work_item_revisions_discussions::Client { + work_item_revisions_discussions::Client(self.clone()) + } + pub fn work_item_transitions_client(&self) -> work_item_transitions::Client { + work_item_transitions::Client(self.clone()) + } + pub fn work_item_type_categories_client(&self) -> work_item_type_categories::Client { + work_item_type_categories::Client(self.clone()) + } + pub fn work_item_type_states_client(&self) -> work_item_type_states::Client { + work_item_type_states::Client(self.clone()) + } + pub fn work_item_types_client(&self) -> work_item_types::Client { + work_item_types::Client(self.clone()) + } + pub fn work_item_types_field_client(&self) -> work_item_types_field::Client { + work_item_types_field::Client(self.clone()) + } + pub fn work_items_client(&self) -> work_items::Client { + work_items::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod classification_nodes { + use super::super::classification_nodes::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets root classification nodes or list of classification nodes for a given list of nodes ids, for a given project. In case ids parameter is supplied you will get list of classification nodes for those ids. Otherwise you will get root classification nodes for this project."] + #[doc = ""] + #[doc = "See [`get_classification_nodes`](super::super::classification_nodes::Client::get_classification_nodes) for details of the arguments."] + pub fn get_classification_nodes( + &self, + organization: impl Into, + project: impl Into, + ids: impl Into, + ) -> get_classification_nodes::RequestBuilder { + get_classification_nodes::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + ids: ids.into(), + depth: None, + error_policy: None, + } + } + #[doc = "Gets root classification nodes under the project."] + #[doc = ""] + #[doc = "See [`get_root_nodes`](super::super::classification_nodes::Client::get_root_nodes) for details of the arguments."] + pub fn get_root_nodes( + &self, + organization: impl Into, + project: impl Into, + ) -> get_root_nodes::RequestBuilder { + get_root_nodes::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + depth: None, + } + } + #[doc = "Gets the classification node for a given node path."] + #[doc = ""] + #[doc = "See [`get`](super::super::classification_nodes::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + structure_group: impl Into, + path: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + structure_group: structure_group.into(), + path: path.into(), + depth: None, + } + } + #[doc = "Create new or update an existing classification node."] + #[doc = ""] + #[doc = "See [`create_or_update`](super::super::classification_nodes::Client::create_or_update) for details of the arguments."] + pub fn create_or_update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + structure_group: impl Into, + path: impl Into, + ) -> create_or_update::RequestBuilder { + create_or_update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + structure_group: structure_group.into(), + path: path.into(), + } + } + #[doc = "Update an existing classification node."] + #[doc = ""] + #[doc = "See [`update`](super::super::classification_nodes::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + structure_group: impl Into, + path: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + structure_group: structure_group.into(), + path: path.into(), + } + } + #[doc = "Delete an existing classification node."] + #[doc = ""] + #[doc = "See [`delete`](super::super::classification_nodes::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + structure_group: impl Into, + path: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + structure_group: structure_group.into(), + path: path.into(), + reclassify_id: None, + } + } + } + } + pub mod queries { + use super::super::models; + use super::super::queries::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Searches all queries the user has access to in the current project"] + #[doc = ""] + #[doc = "See [`search_queries`](super::super::queries::Client::search_queries) for details of the arguments."] + pub fn search_queries( + &self, + organization: impl Into, + project: impl Into, + filter: impl Into, + ) -> search_queries::RequestBuilder { + search_queries::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + filter: filter.into(), + top: None, + expand: None, + include_deleted: None, + } + } + #[doc = "Gets the root queries and their children"] + #[doc = ""] + #[doc = "See [`list`](super::super::queries::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + expand: None, + depth: None, + include_deleted: None, + } + } + #[doc = "Retrieves an individual query and its children"] + #[doc = ""] + #[doc = "See [`get`](super::super::queries::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + query: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + query: query.into(), + expand: None, + depth: None, + include_deleted: None, + use_iso_date_format: None, + } + } + #[doc = "Creates a query, or moves a query.\n\nLearn more about Work Item Query Language (WIQL) syntax [here](https://docs.microsoft.com/en-us/vsts/collaborate/wiql-syntax?toc=/vsts/work/track/toc.json&bc=/vsts/work/track/breadcrumb/toc.json&view=vsts)."] + #[doc = ""] + #[doc = "See [`create`](super::super::queries::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + query: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + query: query.into(), + validate_wiql_only: None, + } + } + #[doc = "Update a query or a folder. This allows you to update, rename and move queries and folders."] + #[doc = ""] + #[doc = "See [`update`](super::super::queries::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + query: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + query: query.into(), + undelete_descendants: None, + } + } + #[doc = "Delete a query or a folder. This deletes any permission change on the deleted query or folder and any of its descendants if it is a folder. It is important to note that the deleted permission changes cannot be recovered upon undeleting the query or folder."] + #[doc = ""] + #[doc = "See [`delete`](super::super::queries::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + query: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + query: query.into(), + } + } + #[doc = "Gets a list of queries by ids (Maximum 1000)"] + #[doc = ""] + #[doc = "See [`get_queries_batch`](super::super::queries::Client::get_queries_batch) for details of the arguments."] + pub fn get_queries_batch( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> get_queries_batch::RequestBuilder { + get_queries_batch::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod recyclebin { + use super::super::models; + use super::super::recyclebin::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the work items from the recycle bin, whose IDs have been specified in the parameters"] + #[doc = ""] + #[doc = "See [`get_deleted_work_items`](super::super::recyclebin::Client::get_deleted_work_items) for details of the arguments."] + pub fn get_deleted_work_items( + &self, + organization: impl Into, + ids: impl Into, + project: impl Into, + ) -> get_deleted_work_items::RequestBuilder { + get_deleted_work_items::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + ids: ids.into(), + project: project.into(), + } + } + #[doc = "Gets a list of the IDs and the URLs of the deleted the work items in the Recycle Bin."] + #[doc = ""] + #[doc = "See [`get_deleted_work_item_shallow_references`](super::super::recyclebin::Client::get_deleted_work_item_shallow_references) for details of the arguments."] + pub fn get_deleted_work_item_shallow_references( + &self, + organization: impl Into, + project: impl Into, + ) -> get_deleted_work_item_shallow_references::RequestBuilder + { + get_deleted_work_item_shallow_references::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Gets a deleted work item from Recycle Bin."] + #[doc = ""] + #[doc = "See [`get`](super::super::recyclebin::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + id: i32, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + project: project.into(), + } + } + #[doc = "Restores the deleted work item from Recycle Bin."] + #[doc = ""] + #[doc = "See [`restore_work_item`](super::super::recyclebin::Client::restore_work_item) for details of the arguments."] + pub fn restore_work_item( + &self, + organization: impl Into, + body: impl Into, + id: i32, + project: impl Into, + ) -> restore_work_item::RequestBuilder { + restore_work_item::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + id, + project: project.into(), + } + } + #[doc = "Destroys the specified work item permanently from the Recycle Bin. This action can not be undone."] + #[doc = ""] + #[doc = "See [`destroy_work_item`](super::super::recyclebin::Client::destroy_work_item) for details of the arguments."] + pub fn destroy_work_item( + &self, + organization: impl Into, + id: i32, + project: impl Into, + ) -> destroy_work_item::RequestBuilder { + destroy_work_item::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + project: project.into(), + } + } + } + } + pub mod comments { + use super::super::comments::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Add a comment on a work item."] + #[doc = ""] + #[doc = "See [`add_work_item_comment`](super::super::comments::Client::add_work_item_comment) for details of the arguments."] + pub fn add_work_item_comment( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + work_item_id: i32, + format: impl Into, + ) -> add_work_item_comment::RequestBuilder { + add_work_item_comment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + work_item_id, + format: format.into(), + } + } + #[doc = "Returns a list of work item comments, pageable."] + #[doc = ""] + #[doc = "See [`get_comments`](super::super::comments::Client::get_comments) for details of the arguments."] + pub fn get_comments( + &self, + organization: impl Into, + project: impl Into, + work_item_id: i32, + ) -> get_comments::RequestBuilder { + get_comments::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + work_item_id, + top: None, + continuation_token: None, + include_deleted: None, + expand: None, + order: None, + } + } + #[doc = "Update a comment on a work item."] + #[doc = ""] + #[doc = "See [`update_work_item_comment`](super::super::comments::Client::update_work_item_comment) for details of the arguments."] + pub fn update_work_item_comment( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + work_item_id: i32, + comment_id: i32, + format: impl Into, + ) -> update_work_item_comment::RequestBuilder { + update_work_item_comment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + work_item_id, + comment_id, + format: format.into(), + } + } + #[doc = "Returns a list of work item comments by ids."] + #[doc = ""] + #[doc = "See [`get_comments_batch`](super::super::comments::Client::get_comments_batch) for details of the arguments."] + pub fn get_comments_batch( + &self, + organization: impl Into, + project: impl Into, + work_item_id: i32, + ids: impl Into, + ) -> get_comments_batch::RequestBuilder { + get_comments_batch::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + work_item_id, + ids: ids.into(), + include_deleted: None, + expand: None, + } + } + #[doc = "Add a comment on a work item."] + #[doc = ""] + #[doc = "See [`add_comment`](super::super::comments::Client::add_comment) for details of the arguments."] + pub fn add_comment( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + work_item_id: i32, + ) -> add_comment::RequestBuilder { + add_comment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + work_item_id, + } + } + #[doc = "Returns a work item comment."] + #[doc = ""] + #[doc = "See [`get_comment`](super::super::comments::Client::get_comment) for details of the arguments."] + pub fn get_comment( + &self, + organization: impl Into, + project: impl Into, + work_item_id: i32, + comment_id: i32, + ) -> get_comment::RequestBuilder { + get_comment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + work_item_id, + comment_id, + include_deleted: None, + expand: None, + } + } + #[doc = "Update a comment on a work item."] + #[doc = ""] + #[doc = "See [`update_comment`](super::super::comments::Client::update_comment) for details of the arguments."] + pub fn update_comment( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + work_item_id: i32, + comment_id: i32, + ) -> update_comment::RequestBuilder { + update_comment::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + work_item_id, + comment_id, + } + } + #[doc = "Delete a comment on a work item."] + #[doc = ""] + #[doc = "See [`delete`](super::super::comments::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + work_item_id: i32, + comment_id: i32, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + work_item_id, + comment_id, + } + } + } + } + pub mod artifact_link_types { + use super::super::artifact_link_types::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the list of work item tracking outbound artifact link types."] + #[doc = ""] + #[doc = "See [`list`](super::super::artifact_link_types::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + } + } + pub mod work_item_icons { + use super::super::models; + use super::super::work_item_icons::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of all work item icons."] + #[doc = ""] + #[doc = "See [`list`](super::super::work_item_icons::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Get a work item icon given the friendly name and icon color."] + #[doc = ""] + #[doc = "See [`get`](super::super::work_item_icons::Client::get) for details of the arguments."] + pub fn get( + &self, + icon: impl Into, + organization: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + icon: icon.into(), + organization: organization.into(), + color: None, + v: None, + } + } + } + } + pub mod work_item_relation_types { + use super::super::models; + use super::super::work_item_relation_types::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the work item relation types."] + #[doc = ""] + #[doc = "See [`list`](super::super::work_item_relation_types::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + #[doc = "Gets the work item relation type definition."] + #[doc = ""] + #[doc = "See [`get`](super::super::work_item_relation_types::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + relation: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + relation: relation.into(), + } + } + } + } + pub mod work_item_transitions { + use super::super::models; + use super::super::work_item_transitions::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns the next state on the given work item IDs."] + #[doc = ""] + #[doc = "See [`list`](super::super::work_item_transitions::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ids: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + ids: ids.into(), + action: None, + } + } + } + } + pub mod account_my_work_recent_activity { + use super::super::account_my_work_recent_activity::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets recent work item activities"] + #[doc = ""] + #[doc = "See [`list`](super::super::account_my_work_recent_activity::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + } + } + } + } + pub mod artifact_uri_query { + use super::super::artifact_uri_query::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Queries work items linked to a given list of artifact URI."] + #[doc = ""] + #[doc = "See [`query`](super::super::artifact_uri_query::Client::query) for details of the arguments."] + pub fn query( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> query::RequestBuilder { + query::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod attachments { + use super::super::attachments::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Uploads an attachment.\n\nOn accounts with higher attachment upload limits (>130MB), you will need to use chunked upload.\nTo upload an attachment in multiple chunks, you first need to [**Start a Chunked Upload**](#start_a_chunked_upload) and then follow the example from the **Upload Chunk** section."] + #[doc = ""] + #[doc = "See [`create`](super::super::attachments::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + file_name: None, + upload_type: None, + area_path: None, + } + } + #[doc = "Downloads an attachment."] + #[doc = ""] + #[doc = "See [`get`](super::super::attachments::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + id: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id: id.into(), + project: project.into(), + file_name: None, + download: None, + } + } + #[doc = "Uploads an attachment chunk.\n\nBefore performing [**Upload a Chunk**](#upload-a-chunk), make sure to have an attachment id returned in **Start a Chunked Upload** example on **Create** section. Specify the byte range of the chunk using Content-Length. For example: \"Content - Length\": \"bytes 0 - 39999 / 50000\" for the first 40000 bytes of a 50000 byte file."] + #[doc = ""] + #[doc = "See [`upload_chunk`](super::super::attachments::Client::upload_chunk) for details of the arguments."] + pub fn upload_chunk( + &self, + organization: impl Into, + body: impl Into, + id: impl Into, + content_range_header: impl Into, + project: impl Into, + ) -> upload_chunk::RequestBuilder { + upload_chunk::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + id: id.into(), + content_range_header: content_range_header.into(), + project: project.into(), + file_name: None, + } + } + } + } + pub mod fields { + use super::super::fields::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns information for all fields. The project ID/name parameter is optional."] + #[doc = ""] + #[doc = "See [`list`](super::super::fields::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + expand: None, + } + } + #[doc = "Create a new field."] + #[doc = ""] + #[doc = "See [`create`](super::super::fields::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Gets information on a specific field."] + #[doc = ""] + #[doc = "See [`get`](super::super::fields::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + field_name_or_ref_name: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + field_name_or_ref_name: field_name_or_ref_name.into(), + project: project.into(), + } + } + #[doc = "Update a field."] + #[doc = ""] + #[doc = "See [`update`](super::super::fields::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + field_name_or_ref_name: impl Into, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + field_name_or_ref_name: field_name_or_ref_name.into(), + project: project.into(), + } + } + #[doc = "Deletes the field. To undelete a filed, see \"Update Field\" API."] + #[doc = ""] + #[doc = "See [`delete`](super::super::fields::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + field_name_or_ref_name: impl Into, + project: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + field_name_or_ref_name: field_name_or_ref_name.into(), + project: project.into(), + } + } + } + } + pub mod project_process_migration { + use super::super::models; + use super::super::project_process_migration::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Migrates a project to a different process within the same OOB type. For example, you can only migrate a project from agile/custom-agile to agile/custom-agile."] + #[doc = ""] + #[doc = "See [`migrate_projects_process`](super::super::project_process_migration::Client::migrate_projects_process) for details of the arguments."] + pub fn migrate_projects_process( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> migrate_projects_process::RequestBuilder { + migrate_projects_process::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod reporting_work_item_links { + use super::super::models; + use super::super::reporting_work_item_links::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a batch of work item links"] + #[doc = ""] + #[doc = "See [`get`](super::super::reporting_work_item_links::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + link_types: None, + types: None, + continuation_token: None, + start_date_time: None, + } + } + } + } + pub mod reporting_work_item_revisions { + use super::super::models; + use super::super::reporting_work_item_revisions::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a batch of work item revisions with the option of including deleted items"] + #[doc = ""] + #[doc = "See [`read_reporting_revisions_get`](super::super::reporting_work_item_revisions::Client::read_reporting_revisions_get) for details of the arguments."] + pub fn read_reporting_revisions_get( + &self, + organization: impl Into, + project: impl Into, + ) -> read_reporting_revisions_get::RequestBuilder { + read_reporting_revisions_get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + fields: None, + types: None, + continuation_token: None, + start_date_time: None, + include_identity_ref: None, + include_deleted: None, + include_tag_ref: None, + include_latest_only: None, + expand: None, + include_discussion_changes_only: None, + max_page_size: None, + } + } + #[doc = "Get a batch of work item revisions. This request may be used if your list of fields is large enough that it may run the URL over the length limit."] + #[doc = ""] + #[doc = "See [`read_reporting_revisions_post`](super::super::reporting_work_item_revisions::Client::read_reporting_revisions_post) for details of the arguments."] + pub fn read_reporting_revisions_post( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> read_reporting_revisions_post::RequestBuilder { + read_reporting_revisions_post::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + continuation_token: None, + start_date_time: None, + expand: None, + } + } + } + } + pub mod work_item_revisions_discussions { + use super::super::models; + use super::super::work_item_revisions_discussions::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`read_reporting_discussions`](super::super::work_item_revisions_discussions::Client::read_reporting_discussions) for details of the arguments."] + pub fn read_reporting_discussions( + &self, + organization: impl Into, + project: impl Into, + ) -> read_reporting_discussions::RequestBuilder { + read_reporting_discussions::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + continuation_token: None, + max_page_size: None, + } + } + } + } + pub mod send_mail { + use super::super::models; + use super::super::send_mail::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "RESTful method to send mail for selected/queried work items."] + #[doc = ""] + #[doc = "See [`send_mail`](super::super::send_mail::Client::send_mail) for details of the arguments."] + pub fn send_mail( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> send_mail::RequestBuilder { + send_mail::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod tags { + use super::super::models; + use super::super::tags::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all the tags for the project."] + #[doc = ""] + #[doc = "See [`list`](super::super::tags::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Get the tag for the project."] + #[doc = ""] + #[doc = "See [`get`](super::super::tags::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + tag_id_or_name: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + tag_id_or_name: tag_id_or_name.into(), + } + } + #[doc = "Update the tag for the project."] + #[doc = ""] + #[doc = "See [`update`](super::super::tags::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + tag_id_or_name: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + tag_id_or_name: tag_id_or_name.into(), + } + } + #[doc = "Delete the tag for the project. Please note, that the deleted tag will be removed from all Work Items as well as Pull Requests."] + #[doc = ""] + #[doc = "See [`delete`](super::super::tags::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + tag_id_or_name: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + tag_id_or_name: tag_id_or_name.into(), + } + } + } + } + pub mod temp_queries { + use super::super::models; + use super::super::temp_queries::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Creates a temporary query\n\nLearn more about Work Item Query Language (WIQL) syntax [here](https://docs.microsoft.com/en-us/vsts/collaborate/wiql-syntax?toc=/vsts/work/track/toc.json&bc=/vsts/work/track/breadcrumb/toc.json&view=vsts)."] + #[doc = ""] + #[doc = "See [`create`](super::super::temp_queries::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod work_items { + use super::super::models; + use super::super::work_items::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a list of work items (Maximum 200)"] + #[doc = ""] + #[doc = "See [`list`](super::super::work_items::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + ids: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + ids: ids.into(), + project: project.into(), + fields: None, + as_of: None, + expand: None, + error_policy: None, + } + } + #[doc = "Returns a single work item from a template."] + #[doc = ""] + #[doc = "See [`get_work_item_template`](super::super::work_items::Client::get_work_item_template) for details of the arguments."] + pub fn get_work_item_template( + &self, + organization: impl Into, + project: impl Into, + type_: impl Into, + ) -> get_work_item_template::RequestBuilder { + get_work_item_template::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + type_: type_.into(), + fields: None, + as_of: None, + expand: None, + } + } + #[doc = "Creates a single work item."] + #[doc = ""] + #[doc = "See [`create`](super::super::work_items::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + type_: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + type_: type_.into(), + validate_only: None, + bypass_rules: None, + suppress_notifications: None, + expand: None, + } + } + #[doc = "Returns a single work item."] + #[doc = ""] + #[doc = "See [`get_work_item`](super::super::work_items::Client::get_work_item) for details of the arguments."] + pub fn get_work_item( + &self, + organization: impl Into, + id: i32, + project: impl Into, + ) -> get_work_item::RequestBuilder { + get_work_item::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + project: project.into(), + fields: None, + as_of: None, + expand: None, + } + } + #[doc = "Updates a single work item."] + #[doc = ""] + #[doc = "See [`update`](super::super::work_items::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: Vec, + id: i32, + project: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + id, + project: project.into(), + validate_only: None, + bypass_rules: None, + suppress_notifications: None, + expand: None, + } + } + #[doc = "Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution."] + #[doc = ""] + #[doc = "See [`delete`](super::super::work_items::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + id: i32, + project: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + project: project.into(), + destroy: None, + } + } + #[doc = "Gets work items for a list of work item ids (Maximum 200)"] + #[doc = ""] + #[doc = "See [`get_work_items_batch`](super::super::work_items::Client::get_work_items_batch) for details of the arguments."] + pub fn get_work_items_batch( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> get_work_items_batch::RequestBuilder { + get_work_items_batch::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Deletes specified work items and sends them to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion."] + #[doc = ""] + #[doc = "See [`delete_work_items`](super::super::work_items::Client::delete_work_items) for details of the arguments."] + pub fn delete_work_items( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> delete_work_items::RequestBuilder { + delete_work_items::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + } + } + pub mod revisions { + use super::super::models; + use super::super::revisions::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns the list of fully hydrated work item revisions, paged."] + #[doc = ""] + #[doc = "See [`list`](super::super::revisions::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + id: i32, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + project: project.into(), + top: None, + skip: None, + expand: None, + } + } + #[doc = "Returns a fully hydrated work item for the requested revision"] + #[doc = ""] + #[doc = "See [`get`](super::super::revisions::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + id: i32, + revision_number: i32, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + revision_number, + project: project.into(), + expand: None, + } + } + } + } + pub mod updates { + use super::super::models; + use super::super::updates::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns a the deltas between work item revisions"] + #[doc = ""] + #[doc = "See [`list`](super::super::updates::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + id: i32, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + project: project.into(), + top: None, + skip: None, + } + } + #[doc = "Returns a single update for a work item"] + #[doc = ""] + #[doc = "See [`get`](super::super::updates::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + id: i32, + update_number: i32, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id, + update_number, + project: project.into(), + } + } + } + } + pub mod comments_reactions { + use super::super::comments_reactions::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets reactions of a comment."] + #[doc = ""] + #[doc = "See [`list`](super::super::comments_reactions::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + work_item_id: i32, + comment_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + work_item_id, + comment_id, + } + } + #[doc = "Adds a new reaction to a comment."] + #[doc = ""] + #[doc = "See [`create`](super::super::comments_reactions::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + project: impl Into, + work_item_id: i32, + comment_id: i32, + reaction_type: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + work_item_id, + comment_id, + reaction_type: reaction_type.into(), + } + } + #[doc = "Deletes an existing reaction on a comment."] + #[doc = ""] + #[doc = "See [`delete`](super::super::comments_reactions::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + work_item_id: i32, + comment_id: i32, + reaction_type: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + work_item_id, + comment_id, + reaction_type: reaction_type.into(), + } + } + } + } + pub mod comment_reactions_engaged_users { + use super::super::comment_reactions_engaged_users::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get users who reacted on the comment."] + #[doc = ""] + #[doc = "See [`list`](super::super::comment_reactions_engaged_users::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + work_item_id: i32, + comment_id: i32, + reaction_type: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + work_item_id, + comment_id, + reaction_type: reaction_type.into(), + top: None, + skip: None, + } + } + } + } + pub mod comments_versions { + use super::super::comments_versions::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`list`](super::super::comments_versions::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + work_item_id: i32, + comment_id: i32, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + work_item_id, + comment_id, + } + } + #[doc = "See [`get`](super::super::comments_versions::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + work_item_id: i32, + comment_id: i32, + version: i32, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + work_item_id, + comment_id, + version, + } + } + } + } + pub mod work_item_type_categories { + use super::super::models; + use super::super::work_item_type_categories::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get all work item type categories."] + #[doc = ""] + #[doc = "See [`list`](super::super::work_item_type_categories::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Get specific work item type category by name."] + #[doc = ""] + #[doc = "See [`get`](super::super::work_item_type_categories::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + category: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + category: category.into(), + } + } + } + } + pub mod work_item_types { + use super::super::models; + use super::super::work_item_types::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns the list of work item types"] + #[doc = ""] + #[doc = "See [`list`](super::super::work_item_types::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Returns a work item type definition."] + #[doc = ""] + #[doc = "See [`get`](super::super::work_item_types::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + type_: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + type_: type_.into(), + } + } + } + } + pub mod work_item_types_field { + use super::super::models; + use super::super::work_item_types_field::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a list of fields for a work item type with detailed references."] + #[doc = ""] + #[doc = "See [`list`](super::super::work_item_types_field::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + type_: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + type_: type_.into(), + expand: None, + } + } + #[doc = "Get a field for a work item type with detailed references."] + #[doc = ""] + #[doc = "See [`get`](super::super::work_item_types_field::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + type_: impl Into, + field: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + type_: type_.into(), + field: field.into(), + expand: None, + } + } + } + } + pub mod work_item_type_states { + use super::super::models; + use super::super::work_item_type_states::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns the state names and colors for a work item type."] + #[doc = ""] + #[doc = "See [`list`](super::super::work_item_type_states::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + type_: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + type_: type_.into(), + } + } + } + } + pub mod templates { + use super::super::models; + use super::super::templates::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets template"] + #[doc = ""] + #[doc = "See [`list`](super::super::templates::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + workitemtypename: None, + } + } + #[doc = "Creates a template"] + #[doc = ""] + #[doc = "See [`create`](super::super::templates::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "Gets the template with specified id"] + #[doc = ""] + #[doc = "See [`get`](super::super::templates::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + template_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + template_id: template_id.into(), + } + } + #[doc = "Replace template contents"] + #[doc = ""] + #[doc = "See [`replace_template`](super::super::templates::Client::replace_template) for details of the arguments."] + pub fn replace_template( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + template_id: impl Into, + ) -> replace_template::RequestBuilder { + replace_template::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + template_id: template_id.into(), + } + } + #[doc = "Deletes the template with given id"] + #[doc = ""] + #[doc = "See [`delete`](super::super::templates::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + template_id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + template_id: template_id.into(), + } + } + } + } + pub mod wiql { + use super::super::models; + use super::super::wiql::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets the results of the query given its WIQL."] + #[doc = ""] + #[doc = "See [`query_by_wiql`](super::super::wiql::Client::query_by_wiql) for details of the arguments."] + pub fn query_by_wiql( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + ) -> query_by_wiql::RequestBuilder { + query_by_wiql::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + time_precision: None, + top: None, + } + } + #[doc = "Gets the results of the query given the query ID."] + #[doc = ""] + #[doc = "See [`query_by_id`](super::super::wiql::Client::query_by_id) for details of the arguments."] + pub fn query_by_id( + &self, + organization: impl Into, + id: impl Into, + project: impl Into, + team: impl Into, + ) -> query_by_id::RequestBuilder { + query_by_id::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id: id.into(), + project: project.into(), + team: team.into(), + time_precision: None, + top: None, + } + } + #[doc = "Gets the results of the query given the query ID."] + #[doc = ""] + #[doc = "See [`get`](super::super::wiql::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + id: impl Into, + project: impl Into, + team: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + id: id.into(), + project: project.into(), + team: team.into(), + time_precision: None, + top: None, + } + } + } + } +} diff --git a/azure_devops_rust_api/src/work/mod.rs b/azure_devops_rust_api/src/work/mod.rs index b4391a9f..e3ad60e9 100644 --- a/azure_devops_rust_api/src/work/mod.rs +++ b/azure_devops_rust_api/src/work/mod.rs @@ -268,11 +268,43 @@ pub mod boardcolumns { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/work/boardcolumns", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -282,9 +314,7 @@ pub mod boardcolumns { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -296,25 +326,24 @@ pub mod boardcolumns { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/work/boardcolumns", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -394,11 +423,43 @@ pub mod boardrows { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/work/boardrows", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -408,9 +469,7 @@ pub mod boardrows { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -422,25 +481,24 @@ pub mod boardrows { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/work/boardrows", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -520,12 +578,45 @@ pub mod iterationcapacities { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) iteration_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/work/iterations/{}/iterationcapacities", + self.client.endpoint(), + self.organization, + self.project, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -535,9 +626,7 @@ pub mod iterationcapacities { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -549,26 +638,24 @@ pub mod iterationcapacities { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/work/iterations/{}/iterationcapacities", - self.client.endpoint(), - self.organization, - self.project, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -723,11 +810,43 @@ pub mod plans { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/work/plans", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -737,9 +856,7 @@ pub mod plans { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -751,25 +868,24 @@ pub mod plans { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/work/plans", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -817,12 +933,45 @@ pub mod plans { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CreatePlan, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/work/plans", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -832,9 +981,7 @@ pub mod plans { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -846,26 +993,24 @@ pub mod plans { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/work/plans", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -913,12 +1058,45 @@ pub mod plans { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/work/plans/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -928,9 +1106,7 @@ pub mod plans { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -942,26 +1118,24 @@ pub mod plans { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/work/plans/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1009,13 +1183,47 @@ pub mod plans { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UpdatePlan, pub(crate) project: String, pub(crate) id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/work/plans/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1025,9 +1233,7 @@ pub mod plans { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1039,27 +1245,24 @@ pub mod plans { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/work/plans/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1104,12 +1307,45 @@ pub mod plans { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/work/plans/{}", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1119,9 +1355,7 @@ pub mod plans { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1133,26 +1367,24 @@ pub mod plans { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/work/plans/{}", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1237,8 +1469,12 @@ pub mod deliverytimeline { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) id: String, @@ -1246,7 +1482,7 @@ pub mod deliverytimeline { pub(crate) start_date: Option, pub(crate) end_date: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Revision of the plan for which you want data. If the current plan is a different revision you will get an ViewRevisionMismatchException exception. If you do not supply a revision you will get data for the latest revision."] pub fn revision(mut self, revision: i32) -> Self { self.revision = Some(revision); @@ -1262,6 +1498,53 @@ pub mod deliverytimeline { self.end_date = Some(end_date.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(revision) = &this.revision { + req.url_mut() + .query_pairs_mut() + .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", &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", &formatted_date_time); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/work/plans/{}/deliverytimeline", + self.client.endpoint(), + self.organization, + self.project, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -1270,9 +1553,7 @@ pub mod deliverytimeline { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1284,44 +1565,24 @@ pub mod deliverytimeline { auth_header, ); } - if let Some(revision) = &this.revision { - req.url_mut() - .query_pairs_mut() - .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", &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", &formatted_date_time); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/work/plans/{}/deliverytimeline", - self.client.endpoint(), - self.organization, - self.project, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1397,11 +1658,43 @@ pub mod processconfiguration { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/_apis/work/processconfiguration", + self.client.endpoint(), + self.organization, + self.project + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1411,9 +1704,7 @@ pub mod processconfiguration { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1425,25 +1716,24 @@ pub mod processconfiguration { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/_apis/work/processconfiguration", - self.client.endpoint(), - self.organization, - self.project - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1522,12 +1812,45 @@ pub mod backlogconfiguration { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/backlogconfiguration", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1537,9 +1860,7 @@ pub mod backlogconfiguration { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1551,26 +1872,24 @@ pub mod backlogconfiguration { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/backlogconfiguration", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1695,12 +2014,45 @@ pub mod backlogs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/backlogs", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1710,9 +2062,7 @@ pub mod backlogs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1724,26 +2074,24 @@ pub mod backlogs { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/backlogs", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1794,13 +2142,47 @@ pub mod backlogs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, pub(crate) backlog_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/backlogs/{}/workItems", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.backlog_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1810,9 +2192,7 @@ pub mod backlogs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1824,27 +2204,24 @@ pub mod backlogs { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/backlogs/{}/workItems", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.backlog_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -1897,13 +2274,47 @@ pub mod backlogs { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, pub(crate) id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/backlogs/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -1913,9 +2324,7 @@ pub mod backlogs { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -1927,27 +2336,24 @@ pub mod backlogs { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/backlogs/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2074,12 +2480,45 @@ pub mod boards { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2089,9 +2528,7 @@ pub mod boards { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2103,26 +2540,24 @@ pub mod boards { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2172,41 +2607,29 @@ pub mod boards { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) id: String, pub(crate) team: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -2225,6 +2648,47 @@ pub mod boards { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -2272,14 +2736,49 @@ pub mod boards { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: serde_json::Value, pub(crate) project: String, pub(crate) id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2289,9 +2788,7 @@ pub mod boards { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2303,28 +2800,24 @@ pub mod boards { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2429,13 +2922,47 @@ pub mod boardusersettings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) board: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/boardusersettings", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.board + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2445,9 +2972,7 @@ pub mod boardusersettings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2459,27 +2984,24 @@ pub mod boardusersettings { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/boardusersettings", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.board - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2529,14 +3051,49 @@ pub mod boardusersettings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: serde_json::Value, pub(crate) project: String, pub(crate) board: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/boardusersettings", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.board + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2546,9 +3103,7 @@ pub mod boardusersettings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2560,28 +3115,24 @@ pub mod boardusersettings { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/boardusersettings", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.board - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2706,13 +3257,47 @@ pub mod cardrulesettings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) board: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/cardrulesettings", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.board + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2722,9 +3307,7 @@ pub mod cardrulesettings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2736,27 +3319,24 @@ pub mod cardrulesettings { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/cardrulesettings", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.board - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2806,14 +3386,49 @@ pub mod cardrulesettings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::BoardCardRuleSettings, pub(crate) project: String, pub(crate) board: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/cardrulesettings", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.board + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2823,9 +3438,7 @@ pub mod cardrulesettings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2837,28 +3450,24 @@ pub mod cardrulesettings { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/cardrulesettings", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.board - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -2903,13 +3512,47 @@ pub mod cardrulesettings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::BoardCardRuleSettings, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/taskboard/cardrulesettings", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -2919,9 +3562,7 @@ pub mod cardrulesettings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -2933,27 +3574,24 @@ pub mod cardrulesettings { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/taskboard/cardrulesettings", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3081,41 +3719,29 @@ pub mod cardsettings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) board: String, pub(crate) team: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -3134,6 +3760,47 @@ pub mod cardsettings { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -3181,14 +3848,49 @@ pub mod cardsettings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::BoardCardSettings, pub(crate) project: String, pub(crate) board: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/cardsettings", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.board + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3198,9 +3900,7 @@ pub mod cardsettings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3212,28 +3912,24 @@ pub mod cardsettings { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/cardsettings", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.board - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3278,13 +3974,47 @@ pub mod cardsettings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::BoardCardSettings, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/taskboard/cardsettings", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -3294,9 +4024,7 @@ pub mod cardsettings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3308,27 +4036,24 @@ pub mod cardsettings { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/taskboard/cardsettings", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3474,8 +4199,12 @@ pub mod chartimages { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, @@ -3486,7 +4215,7 @@ pub mod chartimages { pub(crate) show_details: Option, pub(crate) title: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The width of the chart in pixels. Must be greater than 0."] pub fn width(mut self, width: i32) -> Self { self.width = Some(width); @@ -3507,6 +4236,56 @@ pub mod chartimages { self.title = Some(title.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(width) = &this.width { + req.url_mut() + .query_pairs_mut() + .append_pair("width", &width.to_string()); + } + if let Some(height) = &this.height { + req.url_mut() + .query_pairs_mut() + .append_pair("height", &height.to_string()); + } + if let Some(show_details) = &this.show_details { + req.url_mut() + .query_pairs_mut() + .append_pair("showDetails", &show_details.to_string()); + } + if let Some(title) = &this.title { + req.url_mut().query_pairs_mut().append_pair("title", title); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/chartimages/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.board, + self.name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3515,9 +4294,7 @@ pub mod chartimages { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3529,46 +4306,24 @@ pub mod chartimages { auth_header, ); } - if let Some(width) = &this.width { - req.url_mut() - .query_pairs_mut() - .append_pair("width", &width.to_string()); - } - if let Some(height) = &this.height { - req.url_mut() - .query_pairs_mut() - .append_pair("height", &height.to_string()); - } - if let Some(show_details) = &this.show_details { - req.url_mut() - .query_pairs_mut() - .append_pair("showDetails", &show_details.to_string()); - } - if let Some(title) = &this.title { - req.url_mut().query_pairs_mut().append_pair("title", title); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/chartimages/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.board, - self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3616,8 +4371,12 @@ pub mod chartimages { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, @@ -3628,7 +4387,7 @@ pub mod chartimages { pub(crate) show_details: Option, pub(crate) title: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "The width of the chart in pixels. Must be greater than 0."] pub fn width(mut self, width: i32) -> Self { self.width = Some(width); @@ -3649,6 +4408,56 @@ pub mod chartimages { self.title = Some(title.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(width) = &this.width { + req.url_mut() + .query_pairs_mut() + .append_pair("width", &width.to_string()); + } + if let Some(height) = &this.height { + req.url_mut() + .query_pairs_mut() + .append_pair("height", &height.to_string()); + } + if let Some(show_details) = &this.show_details { + req.url_mut() + .query_pairs_mut() + .append_pair("showDetails", &show_details.to_string()); + } + if let Some(title) = &this.title { + req.url_mut().query_pairs_mut().append_pair("title", title); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/iterations/{}/chartimages/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.iteration_id, + self.name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3657,9 +4466,7 @@ pub mod chartimages { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3671,46 +4478,24 @@ pub mod chartimages { auth_header, ); } - if let Some(width) = &this.width { - req.url_mut() - .query_pairs_mut() - .append_pair("width", &width.to_string()); - } - if let Some(height) = &this.height { - req.url_mut() - .query_pairs_mut() - .append_pair("height", &height.to_string()); - } - if let Some(show_details) = &this.show_details { - req.url_mut() - .query_pairs_mut() - .append_pair("showDetails", &show_details.to_string()); - } - if let Some(title) = &this.title { - req.url_mut().query_pairs_mut().append_pair("title", title); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/iterations/{}/chartimages/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.iteration_id, - self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3758,8 +4543,12 @@ pub mod chartimages { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, @@ -3770,7 +4559,7 @@ pub mod chartimages { pub(crate) show_details: Option, pub(crate) title: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "Number of iterations the chart is for."] pub fn iterations_number(mut self, iterations_number: i32) -> Self { self.iterations_number = Some(iterations_number); @@ -3796,6 +4585,60 @@ pub mod chartimages { self.title = Some(title.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(iterations_number) = &this.iterations_number { + req.url_mut() + .query_pairs_mut() + .append_pair("iterationsNumber", &iterations_number.to_string()); + } + if let Some(width) = &this.width { + req.url_mut() + .query_pairs_mut() + .append_pair("width", &width.to_string()); + } + if let Some(height) = &this.height { + req.url_mut() + .query_pairs_mut() + .append_pair("height", &height.to_string()); + } + if let Some(show_details) = &this.show_details { + req.url_mut() + .query_pairs_mut() + .append_pair("showDetails", &show_details.to_string()); + } + if let Some(title) = &this.title { + req.url_mut().query_pairs_mut().append_pair("title", title); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/iterations/chartimages/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -3804,9 +4647,7 @@ pub mod chartimages { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -3818,50 +4659,24 @@ pub mod chartimages { auth_header, ); } - if let Some(iterations_number) = &this.iterations_number { - req.url_mut() - .query_pairs_mut() - .append_pair("iterationsNumber", &iterations_number.to_string()); - } - if let Some(width) = &this.width { - req.url_mut() - .query_pairs_mut() - .append_pair("width", &width.to_string()); - } - if let Some(height) = &this.height { - req.url_mut() - .query_pairs_mut() - .append_pair("height", &height.to_string()); - } - if let Some(show_details) = &this.show_details { - req.url_mut() - .query_pairs_mut() - .append_pair("showDetails", &show_details.to_string()); - } - if let Some(title) = &this.title { - req.url_mut().query_pairs_mut().append_pair("title", title); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/iterations/chartimages/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -3998,25 +4813,57 @@ pub mod charts { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) board: String, pub(crate) team: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/charts", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.board + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] #[doc = "However, this function can provide more flexibility when required."] pub fn send(self) -> BoxFuture<'static, azure_core::Result> { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4028,27 +4875,24 @@ pub mod charts { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/charts", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.board - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4099,14 +4943,49 @@ pub mod charts { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) board: String, pub(crate) name: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/charts/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.board, + self.name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4116,9 +4995,7 @@ pub mod charts { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4130,28 +5007,24 @@ pub mod charts { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/charts/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.board, - self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4201,8 +5074,12 @@ pub mod charts { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::BoardChart, pub(crate) project: String, @@ -4210,6 +5087,38 @@ pub mod charts { pub(crate) name: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/charts/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.board, + self.name + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4219,9 +5128,7 @@ pub mod charts { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4233,29 +5140,24 @@ pub mod charts { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/charts/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.board, - self.name - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4362,13 +5264,47 @@ pub mod columns { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) board: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/columns", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.board + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4378,9 +5314,7 @@ pub mod columns { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4392,27 +5326,24 @@ pub mod columns { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/columns", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.board - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4462,14 +5393,49 @@ pub mod columns { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) board: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/columns", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.board + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4479,9 +5445,7 @@ pub mod columns { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4493,28 +5457,24 @@ pub mod columns { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/columns", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.board - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4621,13 +5581,47 @@ pub mod rows { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) board: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/rows", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.board + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4637,9 +5631,7 @@ pub mod rows { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4651,27 +5643,24 @@ pub mod rows { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/rows", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.board - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4721,14 +5710,49 @@ pub mod rows { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) board: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/{}/rows", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.board + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -4738,9 +5762,7 @@ pub mod rows { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4752,28 +5774,24 @@ pub mod rows { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/{}/rows", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.board - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -4857,26 +5875,67 @@ pub mod boardparents { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) child_backlog_context_category_ref_name: String, pub(crate) workitem_ids: String, pub(crate) team: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] - #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let child_backlog_context_category_ref_name = + &this.child_backlog_context_category_ref_name; + req.url_mut().query_pairs_mut().append_pair( + "childBacklogContextCategoryRefName", + child_backlog_context_category_ref_name, + ); + let workitem_ids = &this.workitem_ids; + req.url_mut() + .query_pairs_mut() + .append_pair("workitemIds", workitem_ids); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/boards/boardparents", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] #[doc = "However, this function can provide more flexibility when required."] pub fn send(self) -> BoxFuture<'static, azure_core::Result> { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -4888,36 +5947,24 @@ pub mod boardparents { auth_header, ); } - let child_backlog_context_category_ref_name = - &this.child_backlog_context_category_ref_name; - req.url_mut().query_pairs_mut().append_pair( - "childBacklogContextCategoryRefName", - child_backlog_context_category_ref_name, - ); - let workitem_ids = &this.workitem_ids; - req.url_mut() - .query_pairs_mut() - .append_pair("workitemIds", workitem_ids); - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/boards/boardparents", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5022,14 +6069,49 @@ pub mod workitemsorder { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ReorderOperation, pub(crate) project: String, pub(crate) team: String, pub(crate) iteration_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/iterations/{}/workitemsorder", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5039,9 +6121,7 @@ pub mod workitemsorder { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5053,28 +6133,24 @@ pub mod workitemsorder { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/iterations/{}/workitemsorder", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5124,13 +6200,47 @@ pub mod workitemsorder { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::ReorderOperation, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/workitemsorder", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5140,9 +6250,7 @@ pub mod workitemsorder { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5154,27 +6262,24 @@ pub mod workitemsorder { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/workitemsorder", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5270,12 +6375,45 @@ pub mod taskboard_columns { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/taskboardcolumns", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5285,9 +6423,7 @@ pub mod taskboard_columns { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5299,26 +6435,24 @@ pub mod taskboard_columns { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/taskboardcolumns", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5368,13 +6502,47 @@ pub mod taskboard_columns { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/taskboardcolumns", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5384,9 +6552,7 @@ pub mod taskboard_columns { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5398,27 +6564,24 @@ pub mod taskboard_columns { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/taskboardcolumns", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5523,13 +6686,47 @@ pub mod taskboard_work_items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, pub(crate) iteration_id: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/taskboardworkitems/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5539,9 +6736,7 @@ pub mod taskboard_work_items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5553,27 +6748,24 @@ pub mod taskboard_work_items { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/taskboardworkitems/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5619,8 +6811,12 @@ pub mod taskboard_work_items { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::UpdateTaskboardWorkItemColumn, pub(crate) project: String, @@ -5628,6 +6824,38 @@ pub mod taskboard_work_items { pub(crate) iteration_id: String, pub(crate) work_item_id: i32, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/taskboardworkitems/{}/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.iteration_id, + self.work_item_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5637,9 +6865,7 @@ pub mod taskboard_work_items { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5651,29 +6877,24 @@ pub mod taskboard_work_items { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/taskboardworkitems/{}/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.iteration_id, - self.work_item_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -5777,40 +6998,28 @@ pub mod teamsettings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -5828,6 +7037,47 @@ pub mod teamsettings { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -5875,13 +7125,47 @@ pub mod teamsettings { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TeamSettingsPatch, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -5891,9 +7175,7 @@ pub mod teamsettings { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -5905,27 +7187,24 @@ pub mod teamsettings { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6096,19 +7375,58 @@ pub mod iterations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, pub(crate) timeframe: Option, } - impl RequestBuilder { + impl RequestBuilder { #[doc = "A filter for which iterations are returned based on relative time. Only Current is supported currently."] pub fn timeframe(mut self, timeframe: impl Into) -> Self { self.timeframe = Some(timeframe.into()); self } + } + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + if let Some(timeframe) = &this.timeframe { + req.url_mut() + .query_pairs_mut() + .append_pair("$timeframe", timeframe); + } + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } + impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] @@ -6117,9 +7435,7 @@ pub mod iterations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6131,31 +7447,24 @@ pub mod iterations { auth_header, ); } - if let Some(timeframe) = &this.timeframe { - req.url_mut() - .query_pairs_mut() - .append_pair("$timeframe", timeframe); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6206,13 +7515,47 @@ pub mod iterations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TeamSettingsIteration, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Post); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6222,9 +7565,7 @@ pub mod iterations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Post); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6236,27 +7577,24 @@ pub mod iterations { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6306,13 +7644,47 @@ pub mod iterations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6322,9 +7694,7 @@ pub mod iterations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6336,27 +7706,24 @@ pub mod iterations { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6401,13 +7768,47 @@ pub mod iterations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6417,9 +7818,7 @@ pub mod iterations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Delete); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6431,27 +7830,24 @@ pub mod iterations { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6504,13 +7900,47 @@ pub mod iterations { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) iteration_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/workitems", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6520,9 +7950,7 @@ pub mod iterations { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6534,27 +7962,24 @@ pub mod iterations { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/workitems", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6714,41 +8139,29 @@ pub mod capacities { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) iteration_id: String, pub(crate) team: String, } - impl RequestBuilder { - #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] #[doc = ""] - #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] - #[doc = "However, this function can provide more flexibility when required."] - pub fn send(self) -> BoxFuture<'static, azure_core::Result> { - Box::pin({ - let this = self.clone(); - async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); - if let Some(auth_header) = this - .client - .token_credential() - .http_authorization_header(&this.client.scopes()) - .await? - { - req.insert_header( - azure_core::http::headers::AUTHORIZATION, - auth_header, - ); - } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); - Ok(Response(this.client.send(&mut req).await?.into())) - } - }) + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) } fn url(&self) -> azure_core::Result { let mut url = azure_core::http::Url::parse(&format!( @@ -6767,6 +8180,47 @@ pub mod capacities { Ok(url) } } + impl RequestBuilder { + #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] + #[doc = ""] + #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."] + #[doc = "However, this function can provide more flexibility when required."] + pub fn send(self) -> BoxFuture<'static, azure_core::Result> { + Box::pin({ + let this = self.clone(); + async move { + let mut req = this.build_request()?; + if let Some(auth_header) = this + .client + .token_credential() + .http_authorization_header(&this.client.scopes()) + .await? + { + req.insert_header( + azure_core::http::headers::AUTHORIZATION, + auth_header, + ); + } + Ok(Response(this.client.send(&mut req).await?.into())) + } + }) + } + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); + } + Ok(Response(self.client.send(&mut req)?.into())) + } + } impl std::future::IntoFuture for RequestBuilder { type Output = azure_core::Result; type IntoFuture = BoxFuture<'static, azure_core::Result>; @@ -6819,14 +8273,49 @@ pub mod capacities { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: Vec, pub(crate) project: String, pub(crate) iteration_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Put); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6836,9 +8325,7 @@ pub mod capacities { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Put); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6850,28 +8337,24 @@ pub mod capacities { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -6925,14 +8408,49 @@ pub mod capacities { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) iteration_id: String, pub(crate) team_member_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.iteration_id, + self.team_member_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -6942,9 +8460,7 @@ pub mod capacities { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -6956,28 +8472,24 @@ pub mod capacities { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.iteration_id, - self.team_member_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7031,8 +8543,12 @@ pub mod capacities { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::CapacityPatch, pub(crate) project: String, @@ -7040,6 +8556,38 @@ pub mod capacities { pub(crate) team_member_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities/{}", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.iteration_id, + self.team_member_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7049,9 +8597,7 @@ pub mod capacities { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7063,29 +8609,24 @@ pub mod capacities { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/capacities/{}", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.iteration_id, - self.team_member_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7193,13 +8734,47 @@ pub mod teamdaysoff { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) iteration_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/teamdaysoff", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7209,9 +8784,7 @@ pub mod teamdaysoff { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7223,27 +8796,24 @@ pub mod teamdaysoff { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/teamdaysoff", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7293,14 +8863,49 @@ pub mod teamdaysoff { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TeamSettingsDaysOffPatch, pub(crate) project: String, pub(crate) iteration_id: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/teamdaysoff", + self.client.endpoint(), + self.organization, + self.project, + self.team, + self.iteration_id + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7310,9 +8915,7 @@ pub mod teamdaysoff { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7324,28 +8927,24 @@ pub mod teamdaysoff { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/iterations/{}/teamdaysoff", - self.client.endpoint(), - self.organization, - self.project, - self.team, - self.iteration_id - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7445,12 +9044,45 @@ pub mod teamfieldvalues { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Get); + let req_body = azure_core::Bytes::new(); + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/teamfieldvalues", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7460,9 +9092,7 @@ pub mod teamfieldvalues { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Get); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7474,26 +9104,24 @@ pub mod teamfieldvalues { auth_header, ); } - let req_body = azure_core::Bytes::new(); - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/teamfieldvalues", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7543,13 +9171,47 @@ pub mod teamfieldvalues { #[doc = r" can finalize the request using the"] #[doc = r" [`RequestBuilder::send()`] method which returns a future"] #[doc = r" that resolves to a lower-level [`Response`] value."] - pub struct RequestBuilder { - pub(crate) client: super::super::Client, + #[doc = r""] + #[doc = r" When created from a [`blocking::Client`](super::super::blocking::Client),"] + #[doc = r" finalize and submit the request using [`RequestBuilder::send()`], which"] + #[doc = r" blocks until the request completes."] + pub struct RequestBuilder { + pub(crate) client: C, pub(crate) organization: String, pub(crate) body: models::TeamFieldValuesPatch, pub(crate) project: String, pub(crate) team: String, } + impl RequestBuilder {} + impl RequestBuilder { + #[doc = "Builds the HTTP request for this operation without sending it."] + #[doc = ""] + #[doc = "The returned request does not include an `Authorization` header."] + pub fn build_request(&self) -> azure_core::Result { + let this = self; + let url = this.url()?; + let mut req = azure_core::http::Request::new(url, azure_core::http::Method::Patch); + req.insert_header("content-type", "application/json"); + let req_body = azure_core::json::to_json(&this.body)?; + req.set_body(req_body); + Ok(req) + } + fn url(&self) -> azure_core::Result { + let mut url = azure_core::http::Url::parse(&format!( + "{}/{}/{}/{}/_apis/work/teamsettings/teamfieldvalues", + self.client.endpoint(), + self.organization, + self.project, + self.team + ))?; + let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); + if !has_api_version_already { + url.query_pairs_mut() + .append_pair("api-version", "7.1-preview"); + } + Ok(url) + } + } impl RequestBuilder { #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."] #[doc = ""] @@ -7559,9 +9221,7 @@ pub mod teamfieldvalues { Box::pin({ let this = self.clone(); async move { - let url = this.url()?; - let mut req = - azure_core::http::Request::new(url, azure_core::http::Method::Patch); + let mut req = this.build_request()?; if let Some(auth_header) = this .client .token_credential() @@ -7573,27 +9233,24 @@ pub mod teamfieldvalues { auth_header, ); } - req.insert_header("content-type", "application/json"); - let req_body = azure_core::json::to_json(&this.body)?; - req.set_body(req_body); Ok(Response(this.client.send(&mut req).await?.into())) } }) } - fn url(&self) -> azure_core::Result { - let mut url = azure_core::http::Url::parse(&format!( - "{}/{}/{}/{}/_apis/work/teamsettings/teamfieldvalues", - self.client.endpoint(), - self.organization, - self.project, - self.team - ))?; - let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version"); - if !has_api_version_already { - url.query_pairs_mut() - .append_pair("api-version", "7.1-preview"); + } + #[cfg(feature = "blocking")] + impl RequestBuilder { + #[doc = "Sends the request, blocking until the response is received, and returns a [`Response`] object."] + pub fn send(self) -> azure_core::Result { + let mut req = self.build_request()?; + if let Some(auth_header) = self + .client + .token_credential() + .http_authorization_header_blocking()? + { + req.insert_header(azure_core::http::headers::AUTHORIZATION, auth_header); } - Ok(url) + Ok(Response(self.client.send(&mut req)?.into())) } } impl std::future::IntoFuture for RequestBuilder { @@ -7610,3 +9267,1369 @@ pub mod teamfieldvalues { } } } +impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + Client::endpoint(self) + } +} +#[doc = "Blocking (non-async) client."] +#[doc = ""] +#[doc = "Requests are sent using the [`HttpClient`](crate::blocking::HttpClient) supplied to [`ClientBuilder::new`]."] +#[doc = "Only PAT and unauthenticated credentials are supported, and requests do not go through"] +#[doc = "the `azure_core` pipeline, so no retry policy is applied."] +#[cfg(feature = "blocking")] +pub mod blocking { + #[derive(Clone)] + pub struct Client { + endpoint: azure_core::http::Url, + credential: crate::Credential, + http_client: std::sync::Arc, + } + #[derive(Clone)] + pub struct ClientBuilder { + credential: crate::Credential, + http_client: std::sync::Arc, + endpoint: Option, + } + impl ClientBuilder { + #[doc = "Create a new instance of `ClientBuilder`, using `http_client` to send requests."] + #[must_use] + pub fn new( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> Self { + Self { + credential, + http_client: std::sync::Arc::new(http_client), + endpoint: None, + } + } + #[doc = "Set the endpoint."] + #[must_use] + pub fn endpoint(mut self, endpoint: impl Into) -> Self { + self.endpoint = Some(endpoint.into()); + self + } + #[doc = "Convert the builder into a `Client` instance."] + pub fn build(self) -> Client { + Client { + endpoint: self + .endpoint + .unwrap_or_else(|| super::DEFAULT_ENDPOINT.to_owned()), + credential: self.credential, + http_client: self.http_client, + } + } + } + impl Client { + pub(crate) fn token_credential(&self) -> &crate::Credential { + &self.credential + } + pub(crate) fn send( + &self, + request: &mut azure_core::http::Request, + ) -> azure_core::Result { + crate::blocking::send(self.http_client.as_ref(), request) + } + #[doc = "Create a new `ClientBuilder`."] + #[must_use] + pub fn builder( + credential: crate::Credential, + http_client: impl crate::blocking::HttpClient + 'static, + ) -> ClientBuilder { + ClientBuilder::new(credential, http_client) + } + pub fn backlogconfiguration_client(&self) -> backlogconfiguration::Client { + backlogconfiguration::Client(self.clone()) + } + pub fn backlogs_client(&self) -> backlogs::Client { + backlogs::Client(self.clone()) + } + pub fn boardcolumns_client(&self) -> boardcolumns::Client { + boardcolumns::Client(self.clone()) + } + pub fn boardparents_client(&self) -> boardparents::Client { + boardparents::Client(self.clone()) + } + pub fn boardrows_client(&self) -> boardrows::Client { + boardrows::Client(self.clone()) + } + pub fn boards_client(&self) -> boards::Client { + boards::Client(self.clone()) + } + pub fn boardusersettings_client(&self) -> boardusersettings::Client { + boardusersettings::Client(self.clone()) + } + pub fn capacities_client(&self) -> capacities::Client { + capacities::Client(self.clone()) + } + pub fn cardrulesettings_client(&self) -> cardrulesettings::Client { + cardrulesettings::Client(self.clone()) + } + pub fn cardsettings_client(&self) -> cardsettings::Client { + cardsettings::Client(self.clone()) + } + pub fn chartimages_client(&self) -> chartimages::Client { + chartimages::Client(self.clone()) + } + pub fn charts_client(&self) -> charts::Client { + charts::Client(self.clone()) + } + pub fn columns_client(&self) -> columns::Client { + columns::Client(self.clone()) + } + pub fn deliverytimeline_client(&self) -> deliverytimeline::Client { + deliverytimeline::Client(self.clone()) + } + pub fn iterationcapacities_client(&self) -> iterationcapacities::Client { + iterationcapacities::Client(self.clone()) + } + pub fn iterations_client(&self) -> iterations::Client { + iterations::Client(self.clone()) + } + pub fn plans_client(&self) -> plans::Client { + plans::Client(self.clone()) + } + pub fn processconfiguration_client(&self) -> processconfiguration::Client { + processconfiguration::Client(self.clone()) + } + pub fn rows_client(&self) -> rows::Client { + rows::Client(self.clone()) + } + pub fn taskboard_columns_client(&self) -> taskboard_columns::Client { + taskboard_columns::Client(self.clone()) + } + pub fn taskboard_work_items_client(&self) -> taskboard_work_items::Client { + taskboard_work_items::Client(self.clone()) + } + pub fn teamdaysoff_client(&self) -> teamdaysoff::Client { + teamdaysoff::Client(self.clone()) + } + pub fn teamfieldvalues_client(&self) -> teamfieldvalues::Client { + teamfieldvalues::Client(self.clone()) + } + pub fn teamsettings_client(&self) -> teamsettings::Client { + teamsettings::Client(self.clone()) + } + pub fn workitemsorder_client(&self) -> workitemsorder::Client { + workitemsorder::Client(self.clone()) + } + } + impl crate::ClientEndpoint for Client { + fn endpoint(&self) -> &azure_core::http::Url { + &self.endpoint + } + } + pub mod boardcolumns { + use super::super::boardcolumns::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get available board columns in a project"] + #[doc = ""] + #[doc = "See [`list`](super::super::boardcolumns::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + } + } + pub mod boardrows { + use super::super::boardrows::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get available board rows in a project"] + #[doc = ""] + #[doc = "See [`list`](super::super::boardrows::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + } + } + pub mod iterationcapacities { + use super::super::iterationcapacities::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get an iteration's capacity for all teams in iteration"] + #[doc = ""] + #[doc = "See [`get`](super::super::iterationcapacities::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + iteration_id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + iteration_id: iteration_id.into(), + } + } + } + } + pub mod plans { + use super::super::models; + use super::super::plans::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get the information for all the plans configured for the given team"] + #[doc = ""] + #[doc = "See [`list`](super::super::plans::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + #[doc = "Add a new plan for the team"] + #[doc = ""] + #[doc = "See [`create`](super::super::plans::Client::create) for details of the arguments."] + pub fn create( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + ) -> create::RequestBuilder { + create::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + } + } + #[doc = "Get the information for the specified plan"] + #[doc = ""] + #[doc = "See [`get`](super::super::plans::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + id: id.into(), + } + } + #[doc = "Update the information for the specified plan"] + #[doc = ""] + #[doc = "See [`update`](super::super::plans::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + id: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + id: id.into(), + } + } + #[doc = "Delete the specified plan"] + #[doc = ""] + #[doc = "See [`delete`](super::super::plans::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + id: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + id: id.into(), + } + } + } + } + pub mod deliverytimeline { + use super::super::deliverytimeline::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get Delivery View Data"] + #[doc = ""] + #[doc = "See [`get`](super::super::deliverytimeline::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + id: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + id: id.into(), + revision: None, + start_date: None, + end_date: None, + } + } + } + } + pub mod processconfiguration { + use super::super::models; + use super::super::processconfiguration::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get process configuration"] + #[doc = ""] + #[doc = "See [`get`](super::super::processconfiguration::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + } + } + } + } + pub mod backlogconfiguration { + use super::super::backlogconfiguration::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Gets backlog configuration for a team"] + #[doc = ""] + #[doc = "See [`get`](super::super::backlogconfiguration::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + } + } + } + } + pub mod backlogs { + use super::super::backlogs::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "List all backlog levels"] + #[doc = ""] + #[doc = "See [`list`](super::super::backlogs::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "Get a list of work items within a backlog level"] + #[doc = ""] + #[doc = "See [`get_backlog_level_work_items`](super::super::backlogs::Client::get_backlog_level_work_items) for details of the arguments."] + pub fn get_backlog_level_work_items( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + backlog_id: impl Into, + ) -> get_backlog_level_work_items::RequestBuilder { + get_backlog_level_work_items::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + backlog_id: backlog_id.into(), + } + } + #[doc = "Get a backlog level"] + #[doc = ""] + #[doc = "See [`get_backlog`](super::super::backlogs::Client::get_backlog) for details of the arguments."] + pub fn get_backlog( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + id: impl Into, + ) -> get_backlog::RequestBuilder { + get_backlog::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + id: id.into(), + } + } + } + } + pub mod boards { + use super::super::boards::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get boards"] + #[doc = ""] + #[doc = "See [`list`](super::super::boards::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "Get board"] + #[doc = ""] + #[doc = "See [`get`](super::super::boards::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + id: impl Into, + team: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + id: id.into(), + team: team.into(), + } + } + #[doc = "Update board options"] + #[doc = ""] + #[doc = "See [`set_board_options`](super::super::boards::Client::set_board_options) for details of the arguments."] + pub fn set_board_options( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + id: impl Into, + team: impl Into, + ) -> set_board_options::RequestBuilder { + set_board_options::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + id: id.into(), + team: team.into(), + } + } + } + } + pub mod boardusersettings { + use super::super::boardusersettings::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get board user settings for a board id"] + #[doc = ""] + #[doc = "See [`get`](super::super::boardusersettings::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + board: impl Into, + team: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + board: board.into(), + team: team.into(), + } + } + #[doc = "Update board user settings for the board id\n\nWe don't want stakeholders to update board settings (currently just autorefresh). The BacklogManagement feature check validates this."] + #[doc = ""] + #[doc = "See [`update`](super::super::boardusersettings::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + board: impl Into, + team: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + board: board.into(), + team: team.into(), + } + } + } + } + pub mod cardrulesettings { + use super::super::cardrulesettings::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get board card Rule settings for the board id or board by name"] + #[doc = ""] + #[doc = "See [`get`](super::super::cardrulesettings::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + board: impl Into, + team: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + board: board.into(), + team: team.into(), + } + } + #[doc = "Update board card Rule settings for the board id or board by name"] + #[doc = ""] + #[doc = "See [`update_board_card_rule_settings`](super::super::cardrulesettings::Client::update_board_card_rule_settings) for details of the arguments."] + pub fn update_board_card_rule_settings( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + board: impl Into, + team: impl Into, + ) -> update_board_card_rule_settings::RequestBuilder { + update_board_card_rule_settings::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + board: board.into(), + team: team.into(), + } + } + #[doc = "Update taskboard card Rule settings"] + #[doc = ""] + #[doc = "See [`update_taskboard_card_rule_settings`](super::super::cardrulesettings::Client::update_taskboard_card_rule_settings) for details of the arguments."] + pub fn update_taskboard_card_rule_settings( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + ) -> update_taskboard_card_rule_settings::RequestBuilder { + update_taskboard_card_rule_settings::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + } + } + pub mod cardsettings { + use super::super::cardsettings::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get board card settings for the board id or board by name"] + #[doc = ""] + #[doc = "See [`get`](super::super::cardsettings::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + board: impl Into, + team: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + board: board.into(), + team: team.into(), + } + } + #[doc = "Update board card settings for the board id or board by name"] + #[doc = ""] + #[doc = "See [`update_board_card_settings`](super::super::cardsettings::Client::update_board_card_settings) for details of the arguments."] + pub fn update_board_card_settings( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + board: impl Into, + team: impl Into, + ) -> update_board_card_settings::RequestBuilder { + update_board_card_settings::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + board: board.into(), + team: team.into(), + } + } + #[doc = "Update taskboard card settings"] + #[doc = ""] + #[doc = "See [`update_taskboard_card_settings`](super::super::cardsettings::Client::update_taskboard_card_settings) for details of the arguments."] + pub fn update_taskboard_card_settings( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + ) -> update_taskboard_card_settings::RequestBuilder { + update_taskboard_card_settings::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + } + } + pub mod chartimages { + use super::super::chartimages::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a board chart image."] + #[doc = ""] + #[doc = "See [`get_board_chart_image`](super::super::chartimages::Client::get_board_chart_image) for details of the arguments."] + pub fn get_board_chart_image( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + board: impl Into, + name: impl Into, + ) -> get_board_chart_image::RequestBuilder { + get_board_chart_image::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + board: board.into(), + name: name.into(), + width: None, + height: None, + show_details: None, + title: None, + } + } + #[doc = "Get an iteration chart image."] + #[doc = ""] + #[doc = "See [`get_iteration_chart_image`](super::super::chartimages::Client::get_iteration_chart_image) for details of the arguments."] + pub fn get_iteration_chart_image( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + iteration_id: impl Into, + name: impl Into, + ) -> get_iteration_chart_image::RequestBuilder { + get_iteration_chart_image::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + iteration_id: iteration_id.into(), + name: name.into(), + width: None, + height: None, + show_details: None, + title: None, + } + } + #[doc = "Get an iterations chart image."] + #[doc = ""] + #[doc = "See [`get_iterations_chart_image`](super::super::chartimages::Client::get_iterations_chart_image) for details of the arguments."] + pub fn get_iterations_chart_image( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + name: impl Into, + ) -> get_iterations_chart_image::RequestBuilder { + get_iterations_chart_image::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + name: name.into(), + iterations_number: None, + width: None, + height: None, + show_details: None, + title: None, + } + } + } + } + pub mod charts { + use super::super::charts::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get board charts"] + #[doc = ""] + #[doc = "See [`list`](super::super::charts::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + board: impl Into, + team: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + board: board.into(), + team: team.into(), + } + } + #[doc = "Get a board chart"] + #[doc = ""] + #[doc = "See [`get`](super::super::charts::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + board: impl Into, + name: impl Into, + team: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + board: board.into(), + name: name.into(), + team: team.into(), + } + } + #[doc = "Update a board chart"] + #[doc = ""] + #[doc = "See [`update`](super::super::charts::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + board: impl Into, + name: impl Into, + team: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + board: board.into(), + name: name.into(), + team: team.into(), + } + } + } + } + pub mod columns { + use super::super::columns::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get columns on a board"] + #[doc = ""] + #[doc = "See [`list`](super::super::columns::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + board: impl Into, + team: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + board: board.into(), + team: team.into(), + } + } + #[doc = "Update columns on a board"] + #[doc = ""] + #[doc = "See [`update`](super::super::columns::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + board: impl Into, + team: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + board: board.into(), + team: team.into(), + } + } + } + } + pub mod rows { + use super::super::models; + use super::super::rows::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get rows on a board"] + #[doc = ""] + #[doc = "See [`list`](super::super::rows::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + board: impl Into, + team: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + board: board.into(), + team: team.into(), + } + } + #[doc = "Update rows on a board"] + #[doc = ""] + #[doc = "See [`update`](super::super::rows::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + board: impl Into, + team: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + board: board.into(), + team: team.into(), + } + } + } + } + pub mod boardparents { + use super::super::boardparents::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Returns the list of parent field filter model for the given list of workitem ids"] + #[doc = ""] + #[doc = "See [`list`](super::super::boardparents::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + child_backlog_context_category_ref_name: impl Into, + workitem_ids: impl Into, + team: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + child_backlog_context_category_ref_name: + child_backlog_context_category_ref_name.into(), + workitem_ids: workitem_ids.into(), + team: team.into(), + } + } + } + } + pub mod workitemsorder { + use super::super::models; + use super::super::workitemsorder::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Reorder Sprint Backlog/Taskboard Work Items"] + #[doc = ""] + #[doc = "See [`reorder_iteration_work_items`](super::super::workitemsorder::Client::reorder_iteration_work_items) for details of the arguments."] + pub fn reorder_iteration_work_items( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + iteration_id: impl Into, + ) -> reorder_iteration_work_items::RequestBuilder { + reorder_iteration_work_items::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + iteration_id: iteration_id.into(), + } + } + #[doc = "Reorder Product Backlog/Boards Work Items"] + #[doc = ""] + #[doc = "See [`reorder_backlog_work_items`](super::super::workitemsorder::Client::reorder_backlog_work_items) for details of the arguments."] + pub fn reorder_backlog_work_items( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + ) -> reorder_backlog_work_items::RequestBuilder { + reorder_backlog_work_items::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + } + } + pub mod taskboard_columns { + use super::super::models; + use super::super::taskboard_columns::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`get`](super::super::taskboard_columns::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "See [`update`](super::super::taskboard_columns::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + team: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + team: team.into(), + } + } + } + } + pub mod taskboard_work_items { + use super::super::models; + use super::super::taskboard_work_items::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "See [`list`](super::super::taskboard_work_items::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + iteration_id: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + iteration_id: iteration_id.into(), + } + } + #[doc = "See [`update`](super::super::taskboard_work_items::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + iteration_id: impl Into, + work_item_id: i32, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + iteration_id: iteration_id.into(), + work_item_id, + } + } + } + } + pub mod teamsettings { + use super::super::models; + use super::super::teamsettings::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a team's settings"] + #[doc = ""] + #[doc = "See [`get`](super::super::teamsettings::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "Update a team's settings"] + #[doc = ""] + #[doc = "See [`update`](super::super::teamsettings::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + } + } + pub mod iterations { + use super::super::iterations::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a team's iterations using timeframe filter"] + #[doc = ""] + #[doc = "See [`list`](super::super::iterations::Client::list) for details of the arguments."] + pub fn list( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + ) -> list::RequestBuilder { + list::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + timeframe: None, + } + } + #[doc = "Add an iteration to the team"] + #[doc = ""] + #[doc = "See [`post_team_iteration`](super::super::iterations::Client::post_team_iteration) for details of the arguments."] + pub fn post_team_iteration( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + ) -> post_team_iteration::RequestBuilder { + post_team_iteration::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "Get team's iteration by iterationId"] + #[doc = ""] + #[doc = "See [`get`](super::super::iterations::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + id: impl Into, + team: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + id: id.into(), + team: team.into(), + } + } + #[doc = "Delete a team's iteration by iterationId"] + #[doc = ""] + #[doc = "See [`delete`](super::super::iterations::Client::delete) for details of the arguments."] + pub fn delete( + &self, + organization: impl Into, + project: impl Into, + id: impl Into, + team: impl Into, + ) -> delete::RequestBuilder { + delete::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + id: id.into(), + team: team.into(), + } + } + #[doc = "Get work items for iteration"] + #[doc = ""] + #[doc = "See [`get_iteration_work_items`](super::super::iterations::Client::get_iteration_work_items) for details of the arguments."] + pub fn get_iteration_work_items( + &self, + organization: impl Into, + project: impl Into, + iteration_id: impl Into, + team: impl Into, + ) -> get_iteration_work_items::RequestBuilder { + get_iteration_work_items::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + iteration_id: iteration_id.into(), + team: team.into(), + } + } + } + } + pub mod capacities { + use super::super::capacities::*; + use super::super::models; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a team's capacity including total capacity and days off"] + #[doc = ""] + #[doc = "See [`get_capacities_with_identity_ref_and_totals`](super::super::capacities::Client::get_capacities_with_identity_ref_and_totals) for details of the arguments."] + pub fn get_capacities_with_identity_ref_and_totals( + &self, + organization: impl Into, + project: impl Into, + iteration_id: impl Into, + team: impl Into, + ) -> get_capacities_with_identity_ref_and_totals::RequestBuilder + { + get_capacities_with_identity_ref_and_totals::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + iteration_id: iteration_id.into(), + team: team.into(), + } + } + #[doc = "Replace a team's capacity"] + #[doc = ""] + #[doc = "See [`replace_capacities_with_identity_ref`](super::super::capacities::Client::replace_capacities_with_identity_ref) for details of the arguments."] + pub fn replace_capacities_with_identity_ref( + &self, + organization: impl Into, + body: Vec, + project: impl Into, + iteration_id: impl Into, + team: impl Into, + ) -> replace_capacities_with_identity_ref::RequestBuilder { + replace_capacities_with_identity_ref::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body, + project: project.into(), + iteration_id: iteration_id.into(), + team: team.into(), + } + } + #[doc = "Get a team member's capacity"] + #[doc = ""] + #[doc = "See [`get_capacity_with_identity_ref`](super::super::capacities::Client::get_capacity_with_identity_ref) for details of the arguments."] + pub fn get_capacity_with_identity_ref( + &self, + organization: impl Into, + project: impl Into, + iteration_id: impl Into, + team_member_id: impl Into, + team: impl Into, + ) -> get_capacity_with_identity_ref::RequestBuilder { + get_capacity_with_identity_ref::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + iteration_id: iteration_id.into(), + team_member_id: team_member_id.into(), + team: team.into(), + } + } + #[doc = "Update a team member's capacity"] + #[doc = ""] + #[doc = "See [`update`](super::super::capacities::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + iteration_id: impl Into, + team_member_id: impl Into, + team: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + iteration_id: iteration_id.into(), + team_member_id: team_member_id.into(), + team: team.into(), + } + } + } + } + pub mod teamdaysoff { + use super::super::models; + use super::super::teamdaysoff::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get team's days off for an iteration"] + #[doc = ""] + #[doc = "See [`get`](super::super::teamdaysoff::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + iteration_id: impl Into, + team: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + iteration_id: iteration_id.into(), + team: team.into(), + } + } + #[doc = "Set a team's days off for an iteration"] + #[doc = ""] + #[doc = "See [`update`](super::super::teamdaysoff::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + iteration_id: impl Into, + team: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + iteration_id: iteration_id.into(), + team: team.into(), + } + } + } + } + pub mod teamfieldvalues { + use super::super::models; + use super::super::teamfieldvalues::*; + pub struct Client(pub(crate) super::Client); + impl Client { + #[doc = "Get a collection of team field values"] + #[doc = ""] + #[doc = "See [`get`](super::super::teamfieldvalues::Client::get) for details of the arguments."] + pub fn get( + &self, + organization: impl Into, + project: impl Into, + team: impl Into, + ) -> get::RequestBuilder { + get::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + project: project.into(), + team: team.into(), + } + } + #[doc = "Update team field values"] + #[doc = ""] + #[doc = "See [`update`](super::super::teamfieldvalues::Client::update) for details of the arguments."] + pub fn update( + &self, + organization: impl Into, + body: impl Into, + project: impl Into, + team: impl Into, + ) -> update::RequestBuilder { + update::RequestBuilder { + client: self.0.clone(), + organization: organization.into(), + body: body.into(), + project: project.into(), + team: team.into(), + } + } + } + } +} diff --git a/azure_devops_rust_api/tests/blocking.rs b/azure_devops_rust_api/tests/blocking.rs new file mode 100644 index 00000000..f02bcc95 --- /dev/null +++ b/azure_devops_rust_api/tests/blocking.rs @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// Tests for the blocking client, using a local mock HTTP server. +// Each blocking test is run with both the ureq and reqwest HTTP clients. +#![cfg(all(feature = "git", feature = "ureq", feature = "reqwest_blocking"))] + +use azure_devops_rust_api::blocking::{HttpClient, ReqwestBlockingClient, UreqClient}; +use azure_devops_rust_api::{git, Credential}; +use std::io::{BufRead, BufReader, Read, Write}; +use std::net::TcpListener; +use std::sync::mpsc; + +const REPO_LIST_JSON: &str = r#"{"count":2,"value":[ + {"id":"r1","name":"repo1","project":{"name":"proj","visibility":"private"},"url":"http://x/r1"}, + {"id":"r2","name":"repo2","project":{"name":"proj","visibility":"private"},"url":"http://x/r2"} +]}"#; + +/// A captured HTTP request: request line, lower-cased headers, and body. +struct Captured { + request_line: String, + headers: Vec<(String, String)>, + body: String, +} + +impl Captured { + fn header(&self, name: &str) -> Option<&str> { + self.headers + .iter() + .find(|(n, _)| n == name) + .map(|(_, v)| v.as_str()) + } +} + +/// Starts a server that answers a single request with the given status and body. +/// Returns the server's base URL and a receiver for the captured request. +fn mock_server(status: u16, body: &'static str) -> (String, mpsc::Receiver) { + let listener = TcpListener::bind("127.0.0.1:0").unwrap(); + let url = format!("http://{}", listener.local_addr().unwrap()); + let (tx, rx) = mpsc::channel(); + std::thread::spawn(move || { + let (stream, _) = listener.accept().unwrap(); + let mut reader = BufReader::new(stream.try_clone().unwrap()); + let mut request_line = String::new(); + reader.read_line(&mut request_line).unwrap(); + let mut headers = Vec::new(); + loop { + let mut line = String::new(); + reader.read_line(&mut line).unwrap(); + let line = line.trim_end(); + if line.is_empty() { + break; + } + let (name, value) = line.split_once(':').unwrap(); + headers.push((name.to_lowercase(), value.trim().to_string())); + } + let content_length = headers + .iter() + .find(|(n, _)| n == "content-length") + .map_or(0, |(_, v)| v.parse().unwrap()); + let mut request_body = vec![0; content_length]; + reader.read_exact(&mut request_body).unwrap(); + tx.send(Captured { + request_line: request_line.trim_end().to_string(), + headers, + body: String::from_utf8(request_body).unwrap(), + }) + .unwrap(); + let mut stream = stream; + write!( + stream, + "HTTP/1.1 {status} X\r\nContent-Type: application/json\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{body}", + body.len() + ) + .unwrap(); + }); + (url, rx) +} + +fn git_client(url: &str) -> git::Client { + git::ClientBuilder::new(Credential::from_pat("secret")) + .endpoint(azure_core::http::Url::parse(url).unwrap()) + .build() +} + +fn blocking_git_client(url: &str, http_client: impl HttpClient + 'static) -> git::blocking::Client { + git::blocking::ClientBuilder::new(Credential::from_pat("secret"), http_client) + .endpoint(azure_core::http::Url::parse(url).unwrap()) + .build() +} + +fn query_returns_parsed_body(http_client: impl HttpClient + 'static) { + let (url, rx) = mock_server(200, REPO_LIST_JSON); + let repos = blocking_git_client(&url, http_client) + .repositories_client() + .list("org", "proj") + .send() + .unwrap() + .into_body() + .unwrap(); + assert_eq!(repos.count, Some(2)); + assert_eq!(repos.value[1].name, "repo2"); + + let req = rx.recv().unwrap(); + assert_eq!( + req.request_line, + "GET //org/proj/_apis/git/repositories?api-version=7.1-preview HTTP/1.1" + ); + // base64(":secret") + assert_eq!(req.header("authorization"), Some("Basic OnNlY3JldA==")); + assert!(req + .header("user-agent") + .unwrap() + .starts_with("azsdk-rust-devops_rust_api/")); +} + +fn post_sends_json_body(http_client: impl HttpClient + 'static) { + let (url, rx) = mock_server( + 201, + r#"{"id":"r3","name":"new","project":{"name":"proj","visibility":"private"},"url":"http://x/r3"}"#, + ); + let options = git::models::GitRepositoryCreateOptions { + name: Some("new".to_string()), + ..Default::default() + }; + let repo = blocking_git_client(&url, http_client) + .repositories_client() + .create("org", options, "proj") + .send() + .unwrap() + .into_body() + .unwrap(); + assert_eq!(repo.id, "r3"); + + let req = rx.recv().unwrap(); + assert!(req + .request_line + .starts_with("POST //org/proj/_apis/git/repositories?")); + assert_eq!(req.header("content-type"), Some("application/json")); + assert_eq!(req.body, r#"{"name":"new"}"#); +} + +fn error_status_is_error(http_client: impl HttpClient + 'static) { + let (url, _rx) = mock_server(404, r#"{"message":"not found"}"#); + let err = blocking_git_client(&url, http_client) + .repositories_client() + .get_repository("org", "missing", "proj") + .send() + .unwrap_err(); + match err.kind() { + azure_core::error::ErrorKind::HttpResponse { status, .. } => { + assert_eq!(*status, azure_core::http::StatusCode::NotFound) + } + kind => panic!("unexpected error kind: {kind:?}"), + } +} + +fn token_credential_is_rejected(http_client: impl HttpClient + 'static) { + #[derive(Debug)] + struct NoToken; + #[async_trait::async_trait] + impl azure_core::credentials::TokenCredential for NoToken { + async fn get_token( + &self, + _scopes: &[&str], + _options: Option>, + ) -> azure_core::Result { + unreachable!() + } + } + let credential = Credential::from_token_credential(std::sync::Arc::new(NoToken)); + let err = git::blocking::ClientBuilder::new(credential, http_client) + .build() + .repositories_client() + .list("org", "proj") + .send() + .unwrap_err(); + assert!(matches!( + err.kind(), + azure_core::error::ErrorKind::Credential + )); +} + +/// Generates a test per HTTP client for each of the given test functions. +macro_rules! blocking_tests { + ($($test:ident),*) => { + mod ureq { + $(#[test] fn $test() { super::$test(super::UreqClient::new()) })* + } + mod reqwest { + $(#[test] fn $test() { super::$test(super::ReqwestBlockingClient::new()) })* + } + }; +} + +blocking_tests!( + query_returns_parsed_body, + post_sends_json_body, + error_status_is_error, + token_credential_is_rejected +); + +#[test] +fn build_request_without_sending() { + let request = git_client("https://example.com") + .repositories_client() + .list("org", "proj") + .include_hidden(true) + .build_request() + .unwrap(); + assert_eq!(request.method(), azure_core::http::Method::Get); + assert_eq!( + request.url().as_str(), + "https://example.com//org/proj/_apis/git/repositories?api-version=7.1-preview&includeHidden=true" + ); + assert!(request + .headers() + .get_optional_str(&azure_core::http::headers::AUTHORIZATION) + .is_none()); +} + +/// The async API is unchanged by the `build_request()` refactor. +#[tokio::test] +async fn async_query_still_works() { + let (url, rx) = mock_server(200, REPO_LIST_JSON); + let repos = git_client(&url) + .repositories_client() + .list("org", "proj") + .await + .unwrap(); + assert_eq!(repos.value.len(), 2); + + let req = rx.recv().unwrap(); + assert_eq!( + req.request_line, + "GET //org/proj/_apis/git/repositories?api-version=7.1-preview HTTP/1.1" + ); + assert_eq!(req.header("authorization"), Some("Basic OnNlY3JldA==")); +}